根据当前日期获取下一周日期数组

**
     * @return string 返回下一周日期数组
     */
    function get_next_week($date){
        $dates = array();
        $time  = strtotime($date.' 12:00:00');
        $w     = date('w', $time);
        if($w == 0){
            $next = 1;
        } else {
            $next = 7 - $w + 1;
        }
        for($i = $next; $i<$next + 7; $i++){
            $dates[] = date('Y-m-d', $time + 3600*24*$i);
        }
        return $dates;
    }

$last_week = get_next_week(date('Y-m-d',time()-60*60*24*14));
array_unshift($last_week, array_pop($last_week));//周日移到数组第一位

获取上一周日期数组 

https://blog.csdn.net/qq_15936309/article/details/58092105

猜你喜欢

转载自blog.csdn.net/m0_37971044/article/details/84590039
今日推荐