Created
May 5, 2016 12:42
-
-
Save AlaaAttya/8d533bc8315f1267d6d1896f0f6ad365 to your computer and use it in GitHub Desktop.
List dates in between a date range
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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