http://www.thinkphp.cn/code/1051.html
//调用demo
date=date(′Y−m−dH:i:s′);//当前时间printr(getthemonth(date = date('Y-m-d H:i:s'); //当前时间
print_r(getthemonth(date=date(′Y−m−dH:i:s′);//当前时间printr(getthemonth(date));
function getthemonth($date)
{
firstday=date(′Y−m−01′,strtotime(firstday = date('Y-m-01', strtotime(firstday=date(′Y−m−01′,strtotime(date));
lastday=date(′Y−m−d′,strtotime("lastday = date('Y-m-d', strtotime("lastday=date(′Y−m−d′,strtotime("firstday +1 month -1 day"));
return array($firstday, $lastday);
}