cal_days_in_month() function is a PHP calendar function. This function always return number of days in a specified calendar for month of year .
Syntax is : -
cal_days_in_month ( $calendar, $month, $year );
parameter are : -
calendar - Required. Calendar for calculate.
month - Required. Month of that calendar
year - Required. Year of that calendar
Return value is length in day of calendar selected month
Example : -
<?php
$num = cal_days_in_month(CAL_GREGORIAN, 8, 2003);
echo "There was $num days in August 2003";
?>
Output is -
There was 31 days in August 2003
0 Comment(s)