$a = date('Y-m', strtotime('-1 month',strtotime('2020-10-31')));
echo $a; // 10
exit;
但31天的时候,-1 month, 返回的月份就不是上个月了哦
php -1 month 的问题
转载
相信坚持的力量,日复一日的习惯.
本文章为转载内容,我们尊重原作者对文章享有的著作权。如有内容错误或侵权问题,欢迎原作者联系我们进行内容更正或删除文章。
提问和评论都可以,用心的回复会被更多人看到
评论
发布评论
相关文章