title: How to create a date range with php?
body: <p>I tried to make time with PHP. start date of 2017-01-29 to 2017-12-29. But that happened I could not print in February because the month maximum of only 28 days. How to order printed anyway but with the February date up to 28.</p>
  <p>my script:</p>
  <pre><code>date_default_timezone_set('UTC');
  
  // Start date
  $date = '2017-01-29';
  // End date
  $end_date = '2017-12-29';
  
  while (strtotime($date) &lt;= strtotime($end_date)) {
      echo &quot;$date\n&quot;;
      echo &quot;&lt;br&gt;&quot;;
      $date = date (&quot;Y-m-d&quot;, strtotime(&quot;+1 month&quot;, strtotime($date)));
  } 
  </code></pre>
  <p>Output:</p>
  <p><a href="https://i.stack.imgur.com/M4a6c.jpg" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/M4a6c.jpg" alt="enter image description here" /></a></p>