用php来获取一个月的第一天和最后一天,最近要开放任务系统,在某个地方看到的,记录一下,分享给大家,不喜勿喷!//调用demo<br>
$date = date('Y-m-d H:i:s'); //当前时间<br>
print_r(getthemonth($date));<br>
<br>
function getthemonth($date)<br>
{<br>
$firstday = date('Y-m-01', strtotime($date));<br>
$lastday = date('Y-m-d', strtotime("$firstday +1 month -1 day"));<br>
return array($firstday, $lastday);<br>
}
AD:真正免费,域名+虚机+企业邮箱=0元