Current Location: Home> Function Categories> cal_days_in_month

cal_days_in_month

Returns the number of days in a month for the specified year and calendar.
Name:cal_days_in_month
Category:Uncategorized
Programming Language:php
One-line Description:Returns the number of days in a month for the specified year and calendar.

Definition and usage

cal_days_in_month() function returns the number of days in a month for the specified year and calendar.

Example

Get the days in a month based on the specified year and calendar:

 <?php
$d = cal_days_in_month ( CAL_GREGORIAN , 2 , 2016 ) ;
echo "There are $d days in February 2016." ;
?>

Run the instance

grammar

 cal_days_in_month ( calendar , month , year ) ;
parameter describe
calendar Required. Specify the calendar to be used. See PHP Calendar Constants .
month Required. Specify the month in the selected calendar.
year Required. Specify the year in the selected calendar.
Similar Functions
Popular Articles