產出不同年份的復活節與3 月21 日之間的天數:
<?phpecho "Easter Day is ". easter_days() . " days after March 21 this year.<br />";echo "Easter Day was ". easter_days(1990) . " days after March 21 in 1990.<br / >";echo "Easter Day was ". easter_days(1342) . " days after March 21 in 1342.<br />";echo "Easter Day will be ". easter_days(2050) . " days after March 21 in 2050.";?>easter_days() 傳回指定年份的復活節與3 月21 日之間的天數。
提示:復活節的日期是被定義在每年春分(3 月21 日)月圓之後第一個星期日。
easter_days( year,method);
參數 | 描述 |
---|---|
year | 可選。定義用於計算復活節日期的年份,為一個數字。若省略,預設使用當年,本地時間。 |
method | 可選。允許您計算其它曆法的復活節日期。例如,如果設定為CAL_EASTER_ROMAN,則使用1582 - 1752 年期間的格利高里曆法。 |
傳回值: | 傳回指定年份的復活節與3 月21 日之間的天數。 |
---|---|
PHP 版本: | 4+ |
更新日誌: | 在PHP 4.3 中, year參數是可選的, method參數是新增的。 |