Código PHP:
<?php
/**
* Returns an array with the dates between to dates given.
*
* @link http://us3.php.net/manual/en/function.date.php#AEN25217
*
* @param mixed $startdate Timestamp or strtotime() recognizeable string
* @param mixed $enddate Timestamp or strtotime() recognizeable string
* @param string[optional] $format date() format string
* @return mixed Array of timestamps or dates if given format
*/
function dates_between($startdate, $enddate, $format=null){
(is_int($startdate)) ? 1 : $startdate = strtotime($startdate);
(is_int($enddate)) ? 1 : $enddate = strtotime($enddate);
if($startdate > $enddate){
return false; //The end date is before start date
}
while($startdate < $enddate){
$arr[] = ($format) ? date($format, $startdate) : $startdate;
$startdate += 86400;
}
$arr[] = ($format) ? date($format, $enddate) : $enddate;
return $arr;
}
$fecha1 = now();
$fecha2 = now()+7*86400; //Una semana
$data = dates_between($fecha1, $fecha2, 'Y-m-d');
foreach ($data as $date) echo $date.'<br>';
?>
Supongo que se usará algo así ;)