时间:2021-07-01 10:21:17 帮助过:23人阅读
function countSeason($start,$end){
$temp = date("Y-m",strtotime("$start +3month"));
while ($temp <= $end){
$time[] = $temp;
$temp = date("Y-m",strtotime("$temp +3month"));
}
return $time;
}
$time = countSeason("2008-10",date("Y-m"));
?>
/*
直接循环
如果是月,则循环变量每次增加1(月)
如果是年,则每次增加12(月),
同时输出date('Y-m')或者 date('Y')
*/
http://www.bkjia.com/PHPjc/444940.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/444940.htmlTechArticlephp教程生成按指定时间以来的,年、季度、月份的下拉列表 function countSeason($start,$end){ $temp = date(Y-m,strtotime($start +3month)); while ($temp = $end){...