fork download
  1. <?php
  2.  
  3. function pegarInicioFimSemana($semana, $ano) { $dto = new DateTime(); $dto->setISODate($ano, $semana); $ret['primeiro_dia'] = $dto->format('d-m-Y'); $dto->modify('+6 days'); $ret['ultimo_dia'] = $dto->format('d-m-Y'); return $ret; } $semana_array = pegarInicioFimSemana(47,2018); print_r($semana_array);
  4.  
Success #stdin #stdout 0.01s 82624KB
stdin
Standard input is empty
stdout
Array
(
    [primeiro_dia] => 19-11-2018
    [ultimo_dia] => 25-11-2018
)