主要用strtotime()这个函数 php 获得前一个月的月份 date("Y-m-d",strtotime("last month")); php获得给定时间的前一个月时间 $record="20101001"; date("Ymd",strtotime("last month",strtotime($record)));
php获取指定时间的上月份
原文:https://www.cnblogs.com/ianlab/p/13019475.html