openmind ☃   January 26, 2008  ☃  PHP: Create a Range of Dates  (, )

$range  = array();
$start  = strtotime("10 days ago");
$end    = strtotime("now");

while($start < $end)
{
  $start = strtotime("+ 1 day",$start);
  array_push($range,date("Y/m/d",$start));
}

print_r($range);

Props to this.

blog comments powered by Disqus