//调用demo
$date = date('Y-m-d H:i:s'); //当前时间
print_r(getthemonth($date));
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);
}