• PHP Video Tutorials

PHP - Function cal_days_in_month()



Syntax

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

Definition and Usage

This function will return the number of days in the month of year for the specified calendar.

Parameters

Sr.No Parameter & Description
1

calendar(Required)

Calendar to use for calculation.

2

month(Required)

Month in the selected calendar

3

year(Required)

Year in the selected calendar

Return Value

The length in days of the selected month in the given calendar.

Example

Try out following example −

<?php
   $num = cal_days_in_month(CAL_GREGORIAN, 1, 20016);
   echo "There was $num days in Jan 20016";
?> 

This will produce the following result −

There was 31 days in Jan 20016
php_function_reference.htm
Advertisements