Ver Mensaje Individual
  #9 (permalink)  
Antiguo 28/09/2014, 21:07
Avatar de carlos_belisario
carlos_belisario
Colaborador
 
Fecha de Ingreso: abril-2010
Ubicación: Venezuela Maracay Aragua
Mensajes: 3.156
Antigüedad: 14 años
Puntos: 461
Respuesta: listar meses y anos en un rango de fechas

Te presento a la clase DateTime de php para manejar las fechas, algo así
Código PHP:
Ver original
  1. <?php
  2. $inicio = new DateTime('2008-12-24');
  3. $fin = new DateTime('2011-11-24');
  4. while ($inicio <= $fin) {
  5.     echo $inicio->format('m-Y');
  6.     echo "<br />";
  7.     $inicio->modify('+ 1 month');
  8. }
__________________
aprende d tus errores e incrementa tu conocimientos
it's not a bug, it's an undocumented feature By @David
php the right way