(PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8)
cal_days_in_month — 返回指定历法中某年某月的天数
$calendar, int $month, int $year): int
此函数返回指定 calendar 中的某 year
中的某 month 的天数。
calendar用来计算的历法
month指定历法中的某月
year指定历法中的某年
指定历法中所选月份的天数
示例 #1 cal_days_in_month() 示例
<?php
$number = cal_days_in_month(CAL_GREGORIAN, 8, 2003); // 31
echo "There were {$number} days in August 2003";
?>