Created
March 5, 2018 13:44
-
-
Save nicolascb/b084936da6ed946b79cb565b103d66b6 to your computer and use it in GitHub Desktop.
PHP - Get days of month
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
function GetDaysOfMonth($year, month){ | |
$start_date = "01-".$month."-".$year; | |
$start_time = strtotime($start_date); | |
$end_time = strtotime("+1 month", $start_time); | |
for($i=$start_time; $i<$end_time; $i+=86400) { | |
$list[] = date('Y-m-d', $i); | |
} | |
return $list; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment