Skip to content

Instantly share code, notes, and snippets.

@AlaaAttya
Created May 5, 2016 12:42
Show Gist options
  • Save AlaaAttya/8d533bc8315f1267d6d1896f0f6ad365 to your computer and use it in GitHub Desktop.
Save AlaaAttya/8d533bc8315f1267d6d1896f0f6ad365 to your computer and use it in GitHub Desktop.
List dates in between a date range
<?php
$start = "2016-03-1";
$end = "2016-03-20";
$dates_in_between = array();
while($start <= $end) {
array_push($dates_in_between, $start);
$start = date('Y-m-d', strtotime($start . " +1 day"));
}
echo "<pre>";
var_dump($dates_in_between);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment