php 输出两个指定日期中间的所有时间

 public function printDates($start, $end)
    {
        $dt_start = strtotime($start);
        $dt_end = strtotime($end);
        while ($dt_start <= $dt_end) {
            $date[date('Y-m-d', $dt_start)] = [];
            $dt_start = strtotime('+1 day', $dt_start);
        }
        return $date;
    }

猜你喜欢

转载自blog.csdn.net/qq_38324424/article/details/106851140