$date1 = "2007-03-24";
$date2 = "2009-06-26";
$diff = abs(strtotime($date2) - strtotime($date1));
$years = floor($diff / (365*60*60*24));
$months = floor(($diff - $years * 365*60*60*24) / (30*60*60*24));
$days = floor(($diff - $years * 365*60*60*24 - $months*30*60*60*24)/ (60*60*24));
$arary_dates = array ();
for ($days=1;$i<=$days;$days++)
{
$array_dates[$days] -> new DateTime(2007,0,$days);
}
I know this code is wrong made, but is the way I can show to you what i want.
I have an initial date and I want to fill an object array dates with every dates since that initial date until final date (using the number of days passed to increment)
How could I do it?