• PHP Video Tutorials

PHP - Function easter_days()



Syntax

easter_days ( [$year [, $method]] );

Definition and Usage

It returns the number of days after March 21 on which Easter falls for a given year. If no year is specified, the current year is assumed.

Parameters

Sr.No Parameter & Description
1

year(Optional)

The year as a number between 1970 an 2037

2

method(Optional)

It allows 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

Return Value

The number of days after March 21st that the Easter Sunday is in the given year.

Example

Try out following example −

<?php
   echo easter_days(1999)."\n";
   echo easter_days(1492)."\n"; 
   echo easter_days(1913);
?> 

This will produce the following result −

14
32
2
php_function_reference.htm
Advertisements