title: PHP - Increment Dates in Loop
body: <pre><code>$end_date = new DateTime($_GET['end_date']); 
  $last_day_this_month = $end_date-&gt;format('d-m-Y'); //outputs 10-03-2015
  
  $start_date = new DateTime($_GET['start_date']);
  $loop_dates = $start_date-&gt;format('d-m-Y'); //outputs 22-04-2015
  
          for($i = $loop_dates; $i &lt;= $last_day_this_month; $i++)
          {
                  echo $i;echo '&lt;br&gt;';
  
  
          }
  </code></pre>
  
  <p>Using below loop increments the year and not dates</p>
  
  <pre><code>for($i = $loop_dates; $i &lt;= $last_day_this_month; $i++)
  </code></pre>
  
  <p>How could I traverse/increment through start/end dates using loop so that it outputs all the dates from <code>10-03-2015</code> to <code>22-04-2015</code>.</p>
  
  <p>P.S: I am using <code>PHP5.3</code> and so want to go with object oriented approach instead of using strtotime</p>