cal_info

(PHP 4 >= 4.1.0, PHP 5, PHP 7, PHP 8)

cal_info返回有关特定日历的信息

描述

cal_info(int $calendar = -1): array

cal_info() 返回有关指定 calendar 的信息。

日历信息以包含元素 calnamecalsymbolmonthabbrevmonthmaxdaysinmonth 的数组形式返回。可作为 calendar 使用的不同日历的名称如下:

如果没有指定 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
)

添加注释

用户贡献注释

此页面没有用户贡献的注释。
To Top