cal_info
cal_info
(PHP 4 >= 4.1.0, PHP 5, PHP 7)
cal_info - 返回有关特定日历的信息
描述
array cal_info ([ int $calendar = -1 ] )
cal_info()
返回指定的信息calendar
。
日历信息以包含calname
,calsymbol
,month
,abbrevmonth
和maxdaysinmonth
元素的数组的形式返回。可以使用的不同日历的名称calendar
如下所示:
- 0或
CAL_GREGORIAN
- 公历日历
- 1或
CAL_JULIAN
- 朱利安日历
- 2或
CAL_JEWISH
- 犹太日历
- 3或
CAL_FRENCH
- 法国革命历法
如果未calendar
指定所有受支持的日历的指定信息作为数组返回。
参数
calendar
日历以返回信息。如果没有指定日历,则返回有关所有日历的信息。
返回值
例子
示例 #1 cal_info() example
<?php
$info = cal_info(0
print_r($info
?>
上面的例子将输出:
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] => Gregorian
[calsymbol] => CAL_GREGORIAN
)
← cal_from_jd
cal_to_jd →