在线时间:8:00-16:00
迪恩网络APP
随时随地掌握行业动态
扫描二维码
关注迪恩网络微信公众号
<?php $year = 2001; //这里输入的年份 $month = 10; //这里输入的月份 switch ($month) { case 1: echo "{$year}年{$month}月的天数是31天"; break; case '3': echo "{$year}年{$month}月的天数是31天"; break; case '5': echo "{$year}年{$month}月的天数是31天"; break; case '7': echo "{$year}年,{$month}月的天数是31天"; break; case '8': echo "{$year}年,{$month}月的天数是31天"; break; case '10': echo "{$year}年,{$month}月的天数是31天"; break; case '12': echo "{$year}年,{$month}月的天数是31天"; break; case '4': echo "{$year}年,{$month}月的天数是30天"; break; case '6': echo "{$year}年,{$month}月的天数是30天"; break; case '9': echo "{$year}年,{$month}月的天数是30天"; break; case '11': echo "{$year}年,{$month}月的天数是30天"; break; case '2': if($year % 4 == 0 && $year % 100 != 0 || $year % 400 == 0 ){ echo "{$year}年,{$month}月的天数是29天"; }else{ echo "{$year}年,{$month}月的天数是28天"; } break; default: echo '你TM乱输入什么玩意,艹!'; break; } ?> <?php $year = 2001; //这里输入的年份 $month = 10; //这里输入的月份 switch ($month) { case '1': case '3': case '5': case '7': case '8': case '10': case '12': echo "{$year}年,{$month}月的天数是31天"; break; case '4': case '6': case '9': case '11': echo "{$year}年,{$month}月的天数是30天"; break; case '2': if($year % 4 == 0 && $year % 100 != 0 || $year % 400 == 0 ){ echo "{$year}年,{$month}月的天数是29天"; }else{ echo "{$year}年,{$month}月的天数是28天"; } break; default: echo '你TM乱输入什么玩意,艹!'; break; } ?>
|
2022-08-18
2022-08-15
2022-08-17
2022-11-06
2022-08-17
请发表评论