//循环输从指定月到当前月
$month = strtotime("2021-05");
$end = strtotime(date('Y-m')+1);
while($month < $end){
//echo date('Y-m', $month)."<br>";
$datearr[]= date('Y-m', $month);
$month = strtotime("+1 month",$month);
}
$datearr=array_reverse($datearr);