I need to return date time start and date time end for each date in a given range:
The input would be:
$start = '2010-11-07 10:00:00';
$end = '2010-11-09 19:00:00';
The expected output would be:
Array
(
Array
(
'2010-11-07',
'2010-11-07 10:00:00' ,
'2010-11-08 00:00:00'
)
Array
(
'2010-11-08' ,
'2010-11-08 00:00:00' ,
'2010-11-09 00:00:00'
)
Array
(
'2010-11-09' ,
'2010-11-09 00:00:00' ,
'2010-11-09 19:00:00'
)
)
I managed to divide the time range into separate days using this thread: https://stackoverflow.com/a/4312630/3132858
However, I cannot get the start and end time for each date. Any help will be appreciated!
Here is a PHP Fiddle with my code.