PHP easter_days()
easter_days() function returns the number of days after March 21, on which Easter falls for a specified year.
Syntax of this function:
easter_days(year,method)
year - defines the year to calculate the midnight on Easter from. If the year parameter is omitted, the current year is used.
(optional)
method - allows you to calculate Easter dates based on other calendars. E.g. it uses the Gregorian calendar during the years 1582 - 1752 when set to CAL_EASTER_ROMAN.
(optional)
Note: If the year is outside of the range for Unix timestamps (before 1970 or after 2037), this function will generate a warning.
Example
It shows the basic use of this function.
<!DOCTYPE html>
<html>
<head>
<title>PHP easter_days()</title>
</head>
<body>
<?php
echo(easter_days());//default date
echo"<br />";
echo(easter_days(1990));//year in 1990
echo"<br />";
echo(easter_days(1342));//year in 1342
echo"<br />";
echo(easter_days(2050));//year in 2050
?>
</body>
</html>
This is the output of the codes above.