cal_days_in_month

(PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8)

cal_days_in_month返回指定历法中某年某月的天数

说明

cal_days_in_month(int $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";
?>

add a note

User Contributed Notes

There are no user contributed notes for this page.
To Top