Initially I am trying to create a function to display how many times does a specific day fall into particular date. for example how many times does Saturday fall into January 1st of certain year to certain year.
<?php
$firstDate = '01/01/2000';
$endDate = '01/01/2012';
$newYearDate= '01/01';
# convert above string to time
$time1 = strtotime($firstDate);
$time2 = strtotime($endDate);
$newYearTime = strtotime($newYearDate);
for($i=$time1; $i<=$time2; $i++){
$saturday = 0;
$chk = date('D', $newYearTime); #date conversion
if($chk == 'Sat' && $chk == $newYearTime){
$saturday++;
}
}
echo $saturday;
?>