// 输入2021-02-03 返回 2020-02-01|2020-02-29
// PHP获取指定时间的 去年月的 时间范围
$start_date = '2021-02-03';
$timestamp = strtotime('-1 year', strtotime($start_date));
$start_date = date('Y-m-01', $timestamp);
$end_date = date('Y-m-' . date('t', $timestamp), $timestamp);
print_r($start_date.'|'.$end_date);
// 2020-02-01|2020-02-29