Php Calendar Function: Days in Month

What is a Cal_days_in_month Function?
How does a Cal_days_in_month Function Work?


This function is used to get the number of days in a month for the calendar type, for the specified year.


int cal_days_in_month( int $calendar, int $month, int $year )

Example :

$num = cal_days_in_month(CAL_GREGORIAN, 8, 2003);
echo "There was $num days in August 2003";
Result :

There was 31 days in August 2003

In the above example "$num" returns the number of days for the month of August, in the year 2003 according to the "Gregorian" Calander

PHP Topics

Ask Questions

Ask Question