Home>Article>Backend Development> How to use php cal_days_in_month function
php cal_days_in_month function is used to return the number of days in a month for the specified year and calendar. Its syntax is cal_days_in_month(calendar,month,year).
php How to use cal_days_in_month function?
Definition and usage
cal_days_in_month() function returns the number of days in a month for the specified year and calendar.
Syntax
cal_days_in_month(calendar,month,year);
Parameters
calendar Required. Specifies the calendar to be used. See PHP Calendar constants.
month Required. Specifies the month in the selected calendar.
year Required. Specifies the year in the selected calendar.
Return Value: Returns the number of days in the selected month for the given year and calendar.
PHP Version: 4.1
Example
Get the number of days in a month for the specified year and calendar:
The above is the detailed content of How to use php cal_days_in_month function. For more information, please follow other related articles on the PHP Chinese website!