PHP cal days in month() Function
|Calendar||Specifies the calendar to use. Look at the PHP Calendar Constants (Required)|
|Month||Specifies the month in the selected calendar (Required)|
|Year||Specifies the year in the selected calendar (Required)|
It returns number of days in a month specified calendar and year.
It is used to count the total number of days in a particular month. Like February 2015 will have 28 days.
<?php $a=cal_days_in_month(CAL_JULIAN,7,2014); echo "There was $a days in July 2014"; ?>
According to the above example we have seleted the JULIAN calendr, July month and 2014.
Note: All three parameters are required.
<?php $a_day_b=cal_days_in_month(CAL_JEWISH,2,2019); echo "There was $a_day_b days in February 2019"; ?>
According to specified calender the days in February month will 29. You can run and check the exact output.