为什么80%的码农都做不了架构师?>>>
代码语言:javascript复制/**
* @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];
}