时间:2021-07-01 10:21:17 帮助过:11人阅读
$time1 = strtotime('2014-10-04'); //开始日期 $time2 = strtotime('2015-02-06'); //结束日期 $month = array(); //定义数组 $month[] = date('Y-m',$time1); while( ($time1 = strtotime('+1 month', $time1)) <= $time2){ $month[] = date('Y-m',$time1); // 取得递增月; } print_r($month);
以上就是PHP 获取两个月之间的中间月的详细内容,更多请关注Gxl网其它相关文章!