Sorry if the title of the question is unclear, I could not summarize more accurately.
This is problem:
For starters, I have an array in this format:
Array (
[0] => 09:00
[1] => 10:00
[2] => 11:00
[3] => 12:00
[4] => 13:00
[5] => 14:00
[6] => 15:00
[7] => 16:00
[8] => 17:00
[9] => 18:00
)
Then some members are not installed, so after that we have something like:
Array (
[0] => 09:00
[1] => 10:00
[6] => 15:00
[7] => 16:00
[8] => 17:00
[9] => 18:00
)
As you can see, the array represents time intervals. Now I need to make all time intervals shorter than 3 hours. So I need to go through the array, and where there are less than 3 members of the original array, output them too. Therefore, in the above example, from 09:00 and 10:00 should not be 11:00, I need to remove them and leave:
Array (
[6] => 15:00
[7] => 16:00
[8] => 17:00
[9] => 18:00
)
How to do it? Logically, I think it would be easiest to check three consecutive indexes and then check the actual times, but I'm open to any suggestions.