PHP获取每月第一天与最后一天

<?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);
?>

posted @ 2014-04-11 17:13  timelesszhuang  阅读(298)  评论(0编辑  收藏  举报