w3resource

PHP: easter_days() function

Description

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

PHP Function Reference

Previous: easter_date
Next: FrenchToJD



Follow us on Facebook and Twitter for latest update.