php cal_days_in_month函数用于对指定的年份和历法,返回一个月中的天数,其语法是cal_days_in_month(calendar,month,year)。
php cal_days_in_month函数怎么用?
定义和用法
cal_days_in_month() 函数针对指定的年份和历法,返回一个月中的天数。
语法
cal_days_in_month(calendar,month,year);
参数
calendar 必需。规定要使用的历法。请参阅 php calendar 常量。
month 必需。规定选定历法中的月。
year 必需。规定选定历法中的年。
返回值: 针对给定的年份和历法,返回选定月份中的天数。
php 版本: 4.1+
实例
针对指定的年份和历法,获取一个月中的天数:
<?php$d=cal_days_in_month(cal_gregorian,10,2005);echo "there was $d days in october 2005";?>
以上就是php cal_days_in_month函数怎么用的详细内容。