Last day of each month within a date range in php
<p>How to get last day of each month within a date range in PHP?</p>

<p>Input:</p>

<blockquote>
  <p>$startdate = '2013-01-15'<br>
  $enddate = '2013-03-15'</p>
</blockquote>

<p>The output that I want is:</p>

<blockquote>
  <p><strong>2013-01-31</strong>   <em>End date of January</em><br>
  <strong>2013-02-28</strong>    <em>End date of February</em><br>
  <strong>2013-03-15</strong>    *End date of March is '2013-03-31' but the end date is '2013-03-15' .</p>
</blockquote>

<p>So I want <code>2013-03-15</code>. </p>

<p>How can I do that?</p>
