PHP easter_days()

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.
  1. <!DOCTYPE html>
  2. <html>
  3. <head>
  4. <title>PHP easter_days()</title>
  5. </head>
  6. <body>
  7.  
  8. <?php
  9. echo(easter_days());//default date
  10. echo"<br />";
  11. echo(easter_days(1990));//year in 1990
  12. echo"<br />";
  13. echo(easter_days(1342));//year in 1342
  14. echo"<br />";
  15. echo(easter_days(2050));//year in 2050
  16. ?>
  17.  
  18. </body>
  19. </html>
This is the output of the codes above.
result

Tags

Add new comment