(PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8)
cal_info — 返回有关特定日历的信息
cal_info() 返回有关指定 calendar
的信息。
日历信息以包含元素 calname
、calsymbol
、month
、abbrevmonth
和 maxdaysinmonth
的数组形式返回。可作为 calendar
使用的不同日历的名称如下:
CAL_GREGORIAN
- 公历
CAL_JULIAN
- 儒略历
CAL_JEWISH
- 犹太历
CAL_FRENCH
- 法国革命历
如果没有指定 calendar
,则返回有关所有支持日历的信息,以数组形式。
calendar
要返回信息的日历。如果没有指定日历,则返回有关所有日历的信息。
示例 #1 cal_info() 示例
<?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 )