3v4l.org

run code in 300+ PHP versions simultaneously
<?php $time = array( 'start' => new DateTime('2014-01-27 22:40:40 UTC'), 'end' => new DateTime('2014-01-28 17:40:40 UTC'), '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);

preferences:
37.9 ms | 402 KiB | 5 Q