Ver Mensaje Individual
  #2 (permalink)  
Antiguo 01/12/2010, 13:32
Hidek1
Colaborador
 
Fecha de Ingreso: octubre-2009
Ubicación: Tokyo - Japan !
Mensajes: 3.867
Antigüedad: 14 años, 6 meses
Puntos: 334
Respuesta: hallar incio y fin semana con función de 6 lineas

Código PHP:
<?php
function getWeeks($d)
{
    foreach(array(
1=>'Monday',7=>'Sunday')as$a=>$b)
    
$c[$b]=date('d-m-Y',strtotime('last '.$b,strtotime($d.'+'.$a.'day')));
    return 
$c;
}
print_r(getWeeks('06-12-2010'));
__________________
More about me...
~ @rhyudek1
~ Github