cal_days_in_month — 返回某個歷法中某年中某月的天數 說明 ¶ int cal_days_in_month ( int $calendar , int $month , int $year ) 該函數返回特定歷法中的某年中的某月的天數。 參數 ¶ calendar 用來計算的某個歷法 month 選定歷法中的某月 year 選定歷法中的某年 返回值 ¶ 指定歷法中選定的某月的天數。
<?php $num = cal_days_in_month(CAL_GREGORIAN, 8, 2003); // 31 echo "There was $num days in August 2003"; ?>