扫码一下
查看教程更方便
返回格利高里历法的信息:
<?php
print_r(cal_info(0));
?>
执行结果
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_info() 函数返回有关指定历法的信息。
cal_info(calendar);
calendar : 可选。规定一个表示要使用的历法的数字。可以使用下面这些常量:
提示:如果 calendar 参数被省略,cal_info() 返回有关所有历法的信息。
返回值: | 返回包含如下日历元素的数组:
|
---|---|
PHP 版本: | 4.1+ |
更新日志: | 在 PHP 5.0 中,calendar 参数是可选的。 |