1 $yue = I('post.yue'); 2 $nian= I('post.nian'); 3 $firstday = date($nian.'-'.$yue.'-01'); 4 $lastday = date('Y-m-d',strtotime("$firstday +1 month -1 day"));
比如,从前台传入2015年7月,var_dump(array($firstday,$lastday));结果如下;