In this article, you will learn how to get the easter days after 21 March which is the Easter Day of that year.
Note: 21st March is called Equinox. So, the Sunday after the full moon that appears after or on the Spring Equinox is the date of Easter Day.
What is the syntax of the easter_days() function in PHP?
easter_days(year,method);
Parameter | Description |
---|---|
year | The year to get the Easter Day in – Required |
method | Calendar to use – Optional |
Examples of the easter_days() function
Example 1. In this example, we will get the number of days after 21 March that is the Easter Day for different years.
<?php
echo "Easter Day is ". easter_days() . " days after 21 March;
echo "Easter Day is ". easter_days(2021) . " days after 21 March;
echo "Easter Day is ". easter_days(2040) . " days after 21 March;
?>