PHP: easter_days() function
Get number of days after March 21 when Easter falls in a given year
The easter_days() function returns the number of days after March 21 on which Easter comes for a given year. The default year is the current year.
Version:
(PHP 4 and above)
Syntax:
easter_days(year, method)
Parameter:
Name | Description | Required / Optional |
Type |
---|---|---|---|
year | The year between 1970 to 2037. | Required | Integer |
method | Calculate easter days based on Gregorian calendar during the year 1582 to 1752 when setting to CAL_EASTER_ROMAN since PHP 4.3.0. | Optional | Integer |
Return value
The number of days after March 21st that the Easter Sunday is in the specified year.
Value Type: Integer.
Example:
<?php
echo(easter_days(1999).'<br>');
echo(easter_days(1251).'<br>');
echo(easter_days(2060));
?>
Sample Output:
14 26 28
View the example in the browser
See also
Previous: easter_date
Next: FrenchToJD
It will be nice if you may share this link in any developer community or anywhere else, from where other developers may find this content. Thanks.
https://www.w3resource.com/php/function-reference/easter_days.php
- Weekly Trends and Language Statistics
- Weekly Trends and Language Statistics