- print_r: documentation ( source)
<?php
$time = array(
'start' => new DateTime('2014-01-27 22:40:40 UTC'),
'end' => new DateTime('2014-01-28 17:40:40'),
'days' => array(),
);
$start = clone $time['start']; $start->setTime(0, 0);
$end = clone $time['end']; $end->setTime(0, 0);
while ($start <= $end) {
$time['days'][] = $start->format("Y-m-d");
$start->modify('+1 day');
}
print_r($time);