php -1 month 的问题



        $a = date('Y-m', strtotime('-1 month',strtotime('2020-10-31')));
        echo $a;      // 10
        exit;

但31天的时候,-1 month, 返回的月份就不是上个月了哦
posted @ 2020-10-31 21:02  盘思动  阅读(269)  评论(0编辑  收藏  举报