<?php
function yearMonthDays($year,$month){
if (in_array($month, array(1, 3, 5, 7, 8, 01, 03, 05, 07, 08, 10, 12))) {
return '31';
}elseif ($month == 2){
if ($year % 400 == 0 || ($year % 4 == 0 && $year % 100 !== 0)) { //判断是否是闰年
return '29';
}else{
return '28';
}
} else {
return '30';
}
}