当前位置:网站首页>Determine which week of the month the day is

Determine which week of the month the day is

2022-07-06 03:53:00 dongjinxin0621

public function get_week_num(){
        $time = strtotime('2022-05-01');
        $wk_day = date('w', strtotime(date('Y-m-1 00:00:00', $time))) ? : 7; // What day is today
        $day = date('d', $time) - (8 - $wk_day); // What's the date today
        echo $day <= 0 ? 1 : ceil($day / 7) + 1; // How many weeks is it
        die;
    }

原网站

版权声明
本文为[dongjinxin0621]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/187/202207060346200991.html