Skip to content

Instantly share code, notes, and snippets.

@cabans
Last active August 29, 2015 13:56
Show Gist options
  • Save cabans/9090869 to your computer and use it in GitHub Desktop.
Save cabans/9090869 to your computer and use it in GitHub Desktop.
PHP: Last and First day of actual month
/** 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