I came to a see a interesting post that i am trying to write a code for that
"Hello,On which of the two days of the week, Saturday or Sunday, does New Year’s Day fall often"
Reference :http://answers.yahoo.com/question/index?qid=20080731110435AAlyxd4
i have found solution
Calendar repeats itself every 400 years, but because 2100 etc are not leap years, the distribution is not even.It turns out that Sunday and Tuesday and Friday have the most occurrences of Jan 1 - 58 every 400 years.
Monday - 56 Tuesday - 58 Wednesday - 57 Thursday - 57 Friday - 58 Saturday – 56 Sunday - 58
But I am not getting, how I can replicate this in PHP?
For this who think that i have not try ans try to downloadvote my question. I have already test the code.
function DayOfNewYearsDay($beginYear,$endYear)
{
for($i=$beginYear;$i<$endYear;$i++)
{
$day = date("l", mktime(1, 1, 1, 1, 1, $i));
if(isset ($days[$day]))
$days[$day]++;
else
$days[$day]=1;
}
return $days;
}
echo print_r(DayOfNewYearsDay(2000, 2400));
But i am not getting 58 Sunday as answer
Any Idea ?