当前位置: 首页 > 网络学院 > 服务端脚本教程 > PHP > cal_info() 函数
The cal_info() function returns an array that contains information about a given calendar.
cal_info()函数的作用是:以一个数组的形式返回给定日历的信息。
The array contains the following elements: calname, calsymbol, month, abbrevmonth and maxdaysinmonth.
这个数组包括下面的元素:calname, calsymbol, month, abbrevmonth 和 maxdaysinmonth
cal_info(calendar) |
Parameter 参数 | Description 描述 |
---|---|
calendar | Optional. Specifies the calendar. The following calendar values can be used: 可选参数。指定需要使用的日历参数:
|
Tip: In PHP 5, if no calendar parameter is specified, information on ALL supported calendars is returned.
提示:在PHP5中,如果日历参数已被指定,那么将返回支持该日历的所有信息。
<?php $calinfo=cal_info(0); print_r($calinfo); ?> |
The output of the code above will be:
上述代码将输出下面的结果:
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 ) |