Solución En esta función, recibiremos la fecha en formato string (posiblemente el formato más común para manejo de variables) para despues hacer la conversión a tipo time dentro de la función. function weekOfYear($date) { $datetotime = strtotime($date); $weekOfYear = intval(date("W", $datetotime)); if (date('n', $datetotime) == "1" && $weekOfYear > 51) { // It's the last …
Sigue leyendo Obtener el número de la semana del año desde la fecha en PHP