PHP cal_info() Function

Definition

The cal_info() function returns information about a calendar.

Syntax

PHP cal_info() Function has the following syntax.

cal_info(calendar);

Parameter

Optional calendar indicates which calendar to get information.

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

If the calendar parameter is omitted, cal_info() returns info about all calendars.

Return

PHP cal_info() Function returns an array containing calendar elements like:

  • calname
  • calsymbol
  • month
  • abbrevmonth
  • maxdaysinmonth

Example

Get information about a calendar


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

The code above generates the following result.





















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions