Output next 35 days from input date

Viewed 178

I am trying to print the next 35 days of a particular date. Here is my function:

$randomdate = '01-01-2015';
$a=0;
while($a<35){
 $date = date("Y-m-d", strtotime("+1 day", strtotime($randomdate)));
 $a++; 
 $randomdate =   $date; 
}

But this prints only 30 days . Its does not get incremented to next date if month changes. Where did I go wrong ?

1 Answers
Related