init_month); // 自动为00:00:00 时分秒 两个时间之间的年和月份 $time2 = time(); // 当前时间 $this->monarr[] = date('Y-m', $time1); // 当前月; while (($time1 = strtotime('+1 month', $time1)) <= $time2) { $this->monarr[] = date('Y-m', $time1); // 取得递增月; } $this->cur_month = date('Y-m', strtotime('-1 month', $time2)); } }