1 function showMonthRange($start, $end) 2 { 3 $end = date(‘Ym‘, strtotime($end)); // 转换为月 4 $range = []; 5 $i = 0; 6 do { 7 $month = date(‘Ym‘, strtotime($start . ‘ + ‘ . $i . ‘ month‘)); 8 //echo $i . ‘:‘ . $month . ‘<br>‘; 9 $range[] = $month; 10 $i++; 11 } while ($month < $end); 12 13 return $range; 14 } 15
时间: 2024-10-07 07:09:54