w3resource

PHP: cal_info() function

Returns information about a particular calendar

The cal_info() function is used to get the information of a specific calendar.

Version:

(PHP 4 and above)

Syntax:

cal_info(calendar)

Parameter:

Name Description Required /
Optional
Type
calendar Supported calendar/values
0 - CAL_GREGORIAN
1- CAL_JULIAN
2 - CAL_JEWISH
3 - CAL_FRENCH
Optional Integer

If no calendar is specified information on all supported calendars is returned as an array.

Return value:

An array.

Value Type: Array.

Example:

<?php
$c_info=cal_info(1);
print_r($c_info);
?>

Sample Output:

Array  ( [months] => Array([1] => January [2] => February [3] => March [4] => April [5] => May [6] => June [7] => July [8] => August [9] => September [10] => October [11] => November [12] => December )[abbrevmonths] => Array ( [1] => Jan [2] => Feb  [3] => Mar [4] => Apr [5] => May [6] => Jun [7] => Jul [8] => Aug  [9] => Sep  [10] => Oct [11] => Nov  [12] => Dec )[maxdaysinmonth] => 31 [calname] => Julian [calsymbol] => CAL_JULIAN  )

View the example in the browser

See also

PHP Function Reference

Previous: cal_from_jd
Next: cal_to_jd



Become a Patron!

Follow us on Facebook and Twitter for latest update.

It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.

https://w3resource.com/php/function-reference/cal_info.php