Haría esto
Código PHP:
Ver originalfunction weekDayOnYear($day,$year){
$md = array(31,28,31,30,31,30,31,31,30,31,30,31); //days to use $c = 0; //counter
for($k=0;$k<sizeof($md);$k++){ //loop for months $dUse = $md[$k]; //how much days for the loop
if($k == 1 && $year%4 == 0 && (!($year%100 == 0) || $year%400 == 0)){ $dUse = 29; } //if leap year
for($n=0;$n<$dUse;$n++){ //loop for days
$c++; //count
}
}
}
return $c; //return
}
Donde:
year: año a verificar
day: día de la semana 1-7 de lunes a domingo
Ex:
Código PHP:
Ver original$lunes = weekDayOnYear(1,2017){
echo "2017 tiene $lunes Lunes";
Saludos