Last active
August 29, 2015 13:56
-
-
Save cabans/9090869 to your computer and use it in GitHub Desktop.
PHP: Last and First day of actual 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
/** Actual month last day **/ | |
function _data_last_month_day() { | |
$month = date('m'); | |
$year = date('Y'); | |
$day = date("d", mktime(0,0,0, $month+1, 0, $year)); | |
return date('Y-m-d', mktime(0,0,0, $month, $day, $year)); | |
}; | |
/** Actual month first day **/ | |
function _data_first_month_day() { | |
$month = date('m'); | |
$year = date('Y'); | |
return date('Y-m-d', mktime(0,0,0, $month, 1, $year)); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment