<?php
function
getthemonth($date)
{
$firstday =
date(‘Y-m-01‘, strtotime($date));
$lastday = date(‘Y-m-d‘,
strtotime("$firstday +1 month -1 day"));
return
array($firstday,$lastday);
}
$today =
date("Y-m-d");
$day=getthemonth($today);
?>
PHP获取每月第一天与最后一天,布布扣,bubuko.com
原文:http://www.cnblogs.com/timelesszhuang/p/3659124.html