PHP cal_info() Function

Example

Returns information about the Gregorian calendar:

<?php
print_r(cal_info(0));
?>

Running Instance

Definition and Usage

The cal_info() function returns information about the specified calendar.

Syntax

cal_info(calendar);
Parameter Description
calendar

Optional. Specify a number indicating the calendar. You can use the following constants:

  • 0 = CAL_GREGORIAN
  • 1 = CAL_JULIAN
  • 2 = CAL_JEWISH
  • 3 = CAL_FRENCH

Tip:If calendar If parameters are omitted, cal_info() returns information about all calendars.

Technical Details

Return Value:

Returns an array containing the following calendar elements:

  • calname
  • calsymbol
  • month
  • abbrevmonth
  • maxdaysinmonth
PHP Version: 4.1+
Update Log: In PHP 5.0,calendar Parameters are optional.