/** * 计算两个月份之间的月份 * * * * * 日期均为2018-08格式 */public function CalcMonths($start,$end){ $time1 = strtotime($start); // 自动为00:00:00 时分秒 $time2 = strtotime($end); $monarr = array(); // $monarr[] = $start; // 当前月; $monarr[]=[ 'list'=>date('Y-m',$time1), ]; while( ($time1 = strtotime('+1 month', $time1)) <= $time2){ // $monarr[] = date('Y-m',$time1); // 取得递增月; $monarr[]=[ 'list'=>date('Y-m',$time1), ]; } return $monarr;}