日期:2014-05-17 浏览次数:20625 次
for($i=1;$i<=12;$i++){
$nextdate = date("Y-m",strtotime("+ $i month"));
echo '<p>'.$nextdate;
}
// 参数表示好多个月,你也可以修改为指定日期开始
function c($num = 12){
$temp = array();
$nowtime = strtotime( date('Y-m', time()) . '-1' );
while( $num>0 ){
$num--;
$nowtime = strtotime( '+1 month', $nowtime );
$temp[] = date('Y-m', $nowtime);
}
unset( $num, $nowtime );
return $temp;
}
print_r( c() );