I am trying to generate trip listing for a bus transit system. I am provided with a bus route's service start time, no of runs per day and frequency.
E.g- If the first run is at 05:00, the next run is at 06:00, 07:00 & son on up to 7 runs. I am stuck at generating the departure & arrival time range array as shown below.
Array
(
[0] => 05:00-06:00
[1] => 06:00-07:00
[2] => 07:00-08:00
[3] => 08:00-09:00
[4] => 09:00-10:00
[5] => 10:00-11:00
)
I am a PHP fresher & have less idea about date and time concept in PHP. So need help on this.