我想获得上个月的第一个日期和最后一个日期.
$first_date = strtotime('first day of previous month', time());
$previous_month_first_date=date('Y-m-d', $first_date);
$previous_month_last_date=date('Y-m-d', strtotime('last day of previous month'));
Run Code Online (Sandbox Code Playgroud) php ×1