title: PHP Day iterator
body: <p>I'm able to show days from current date to next 3 months with this code:</p>
  
  <pre><code>$begin = new DateTime();
  $end = new DateTime(date('Y-m-d', strtotime('+3 months', strtotime(date("d-m-Y")))));
  $interval = DateInterval::createFromDateString('1 day');
  $days = new DatePeriod($begin, $interval, $end);
  
  foreach ( $days as $day ) {
      ...
  }
  </code></pre>
  
  <p>I feel the code can be shortened especially for <code>$end</code>. Could you help?</p>
  
  <p>Oh, I also want to get previous 3 months. I changed <code>'+3 months'</code> to <code>'-3 months'</code>but no luck. Any ideas?</p>