3v4l.org

run code in 300+ PHP versions simultaneously
<?php function dateRange($first, $last, $step = '+1 day', $format = 'd/m/Y' ) { echo $first; echo "<br>"; echo $last; echo "<br>"; echo $step; echo "<br>"; $dates = array(); $current = strtotime($first); $last = strtotime($last); while( $current <= $last ) { $dates[] = date($format, $current); $current = strtotime($step, $current); } print_r($dates); exit; return $dates; } dateRange('20-05-2014', '31-05-2014');

preferences:
44.55 ms | 402 KiB | 5 Q