一个方法得到哪年的哪个月的天数?
参数为年份和月份,输出结果为指定月的天数
只需函数strtotime()
<?php
Function day_count($year,$month){ Echo date("t",strtotime($year."-".$month)); } echo day_count('2015','2');
参数为年份和月份,输出结果为指定月的天数
只需函数strtotime()
<?php
Function day_count($year,$month){ Echo date("t",strtotime($year."-".$month)); } echo day_count('2015','2');