<?php
$year = 2001;
$moth = 2;
switch ($moth) {case '1':echo "{$moth}月有31天";break;case '2':if($year%4 == 0 && $year%100 != 0 || $year%400 ==0 ){echo "{$year}年的{$moth}有29天";}else{echo "{$year}年的{$moth}有28天";}break;default:echo "请输入正确的月份";break;
}
?>
<?php
$year = 2001;
$moth = 2;
switch ($moth) {case '1':echo "{$moth}月有31天";break;case '2':if($year%4 == 0 && $year%100 != 0 || $year%400 ==0 ){echo "{$year}年的{$moth}有29天";}else{echo "{$year}年的{$moth}有28天";}break;default:echo "请输入正确的月份";break;
}
?>