- strtotime: documentation ( source)
<?php
function daycount($day, $startdate, $enddate, $counter)
{
if($startdate >= $enddate)
{
return $counter;
}
else
{
return daycount($day, strtotime("next ".$day, $startdate), ++$counter);
}
}
echo daycount("monday", strtotime("18.01.2016"), 0);