cal_days_in_month() function returns the number of days in a month for the specified year and calendar.
cal_days_in_month(calendar,month,year);
calendar - The calendar to use.
Month - The month to specify.
year - The year to specify.
cal_days_in_month() function returns the number of days in a month for the specified year and calendar.
The following is an example -
Live Demo
<?php $res = cal_days_in_month(CAL_GREGORIAN, 3, 2018); echo "$res days"; ?>
31 days
The above is the detailed content of cal_days_in_month() function in PHP. For more information, please follow other related articles on the PHP Chinese website!