/** * @param $date * @return array上個月的月初和月末 */ public function GetlastMonthDays($date){ $timestamp=strtotime($date); $firstday=date('Y-m-d',strtotime(date('Y',$timestamp).'-'.(date('m',$timestamp)-1).'-01')); $lastday=date('Y-m-d',strtotime("$firstday +1 month -1 day")); return ['start_last_month'=>$firstday,'end_last_month'=>$lastday]; }