PHP获取指定时间的上个月

2024-02-14 10:20:22 举报文章
//by www.qzphp.cn
主要用strtotime()这个函数
php 获得前一个月的月份
date("Y-m-d",strtotime("last month"));
php获得给定时间的前一个月时间
$record="20101001";
date("Ymd",strtotime("last month",strtotime($record)));
如果你认为本文可读性较差,内容错误,或者文章排版错乱,请点击举报文章按钮,我们会立即处理!