- print_r: documentation ( source)
- date: documentation ( source)
- strtotime: documentation ( source)
<?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');