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