Created
March 20, 2015 07:42
-
-
Save imvaskii/e4c5419125590d5592ca to your computer and use it in GitHub Desktop.
Get date range between start and end date
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 | |
function returnDates($fromdate, $todate) { | |
$date_list = array(); | |
$fromdate = date(strtotime($fromdate)); | |
$todate = date(strtotime($todate)); | |
for ($i = $fromdate; $i <= $todate; $i+=86400) { | |
array_push($date_list, date("Y/m/d H", $i)); | |
} | |
return $date_list; | |
} | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment