php: possible to convert array of numbers to 'from' and 'to' pairs where consecutive?
- by Haroldo
I have an array of timestamps referring to the days when a holiday home is booked.
each timestamp is a round day.
I want to turn this into an array of 'begins' and 'ends' pairs for consecutive dates
Are there any php functions I should be aware of for writing this function?
Or does anyone have any pointers for this kind of thing?
thanks!
edit:
example array:
Array
(
[0] => 1273536000
[1] => 1273622400
[2] => 1273708800
[3] => 1273795200
[4] => 1273881600
[5] => 1273968000
[6] => 1274054400
[7] => 1274140800
[8] => 1274227200
)
where a day = 86400 (seconds)