返回某個曆法中某年中某月的天數

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

用來計算的某個曆法

month

選定曆法中的某月

year

選定曆法中的某年

返回值

指定曆法中選定的某月的天數。

範例

示例 #1 cal_days_in_month() example

<?php
$num 
cal_days_in_month(CAL_GREGORIAN82003); // 31
echo "There was $num days in August 2003";
?>

發佈留言

發佈留言必須填寫的電子郵件地址不會公開。 必填欄位標示為 *