$start = '2017-10'; $end = date('Ym'); $range = []; $i = 0; do { $month = date('Ym', strtotime($start . ' + ' . $i . ' month')); $range[] = $month; $i++; } while (strtotime($month) < strtotime($end));
取时间段的月份
最新推荐文章于 2019-12-03 16:20:11 发布
$start = '2017-10'; $end = date('Ym'); $range = []; $i = 0; do { $month = date('Ym', strtotime($start . ' + ' . $i . ' month')); $range[] = $month; $i++; } while (strtotime($month) < strtotime($end));