cal_info

cal_info() 函式返回一個數組,其中包含了關於給定曆法的信息。

基本介紹

  • 中文名:cal_info
  • 包含 :關於給定曆法的信息
  • 返回的數組:包含calname, calsymbol,等元素
  • 常量:: CAL_JULIAN、CAL_JEWISH等
定義和用法,語法,提示和注釋,例子,

定義和用法

所返回的數組包含這些元素:calname, calsymbol, month, abbrevmonth 以及 maxdaysinmonth。

語法

cal_from_jd(jd,calendar)
參數
描述
calendar
必需。規定要使用的曆法。可以使用下面這些常量:
CAL_GREGORIAN
CAL_JULIAN
CAL_JEWISH
CAL_FRENCH

提示和注釋

提示:在 PHP 5 中,如果沒有指定 calendar 參數,則返回所有被支持的曆法的信息。

例子

<?php
$calinfo=cal_info(0);
print_r($calinfo);
?>
輸出:
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 )
PHP Array 函式

相關詞條

熱門詞條

聯絡我們