cal_days_in_month() • How To Get the Number of Days in any Month of any Year?

Date Published: 05/04/2020 Published By: JaiSchool

The cal_days_in_month() function returns the number of days in a specific month of a year. This is the predefined function of PHP.

cal_days_in_month() function syntax


Example : -


$days = cal_days_in_month(CAL_GREGORIAN,2,2020);

echo $days;


Know all the number of days in any year


$days = 0;

	$days += cal_days_in_month(CAL_GREGORIAN,$i,2020);
	echo $days;


Publish A Comment

Leave a Reply

Your email address will not be published. Required fields are marked *