Curriculum
Course: PHP Basic
Login

Curriculum

PHP Basic

PHP Install

0/1

PHP Casting

0/1

PHP Constants

0/1

PHP Magic Constants

0/1

PHP Operators

0/1

PHP Reference

0/276
Text lesson

cal_info()

Example

Retrieve information about the Gregorian calendar.

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

Definition and Usage

The cal_info() function provides information about a specified calendar system.

Syntax

cal_info(calendar);

Parameter Values

Parameter

Description

calendar

Optional. Specifies a number indicating which calendar to return information about:

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

Tip: If the calendar parameter is omitted, cal_info() returns information about all calendars.

Technical Details

Return Value:

Returns an array containing calendar elements such as:

  • calname
  • calsymbol
  • month
  • abbrevmonth
  • maxdaysinmonth

PHP Version:

4.1+

Changelog:

In PHP 5.0, the calendar parameter became optional.