当前位置:网站首页>PHP get last Monday, get the last week date of the specified date, last Monday

PHP get last Monday, get the last week date of the specified date, last Monday

2022-06-09 07:38:00 Black paint # 000000

 PHP Get last Monday , Get the last week date of the specified date , last Monday

        $end_date = '2022-02-26';
        $w = date("w", strtotime($end_date)); //  week 
        if( $w == 0 ) $w = 7; // 0= Sunday 
        $n = $w - 1 + 7; //  last Monday 
        $date = date('Y-m-d', strtotime("-{$top_day_n} days", strtotime($end_date)));

        echo "{$end_date} Last Monday :{$date}";

原网站

版权声明
本文为[Black paint # 000000]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/03/202203021418122708.html