PHP计算近1年的所有月份 话不多说,请看代码: $z=date('Y-m');$a=date('Y-m',strtotime('-12months'));$begin=newDateTime($a);$end=new 月份计算