Ver Mensaje Individual
  #3 (permalink)  
Antiguo 16/08/2009, 13:45
Avatar de urgido
urgido
 
Fecha de Ingreso: febrero-2005
Mensajes: 2.351
Antigüedad: 19 años, 2 meses
Puntos: 25
Respuesta: Mostrar las fechas que hay entre 2 fechas

Código php:
Ver original
  1. <?
  2. $inicia = "2009-04-05";
  3. $termina = "2009-06-05";
  4.  
  5. $init_date = strtotime($inicia);
  6. $dst_date = strtotime($termina);
  7.  
  8. $offset = $dst_date-$init_date;
  9.  
  10. $fechas = floor($offset/60/60/24) + 1;
  11.  
  12. for($i = 0; $i < $fechas; $i++){
  13. $fechanueva = date("Y-m-d", mktime(12,0,0,date("m", strtotime($inicia)),
  14. (date("d", strtotime($inicia)) + $i), date("Y", strtotime($inicia))));
  15. echo $fechanueva ."<br>";
  16. }
  17. ?>

Espero y también te sirva. Saludos
__________________
Hospedaje Web al mejor costo!