title: PHP: Adding months to a date, while not exceeding the last day of the month
body: <p>Looking to create a function that will do this in PHP.  </p>
  
  <p>I need to add a number of months to a date, but not exceed
  the last day of the month in doing so.  </p>
  
  <p>For example:</p>
  
  <pre><code>Add 1 month to January (1-28th), 2011, should produce February (1-28th), 2011.
  Add 1 month to January 30th, 2011, should produce February 28th, 2011.
  Add 3 months to January 31st, 2011, should produce April 30th, 2011.
  Add 13 months to January 30th, 2011, should produce February 29th, 2012.
  Add 1 month to October 31st, 2011, should produce November 30th, 2011.
  </code></pre>
  
  <p>If I use date addition in PHP, I get overruns:</p>
  
  <pre><code>Adding 1 month to January 30th, 2011, results in March 2nd, 2011.
  </code></pre>
  
  <p>My specification doesn't allow me to overrun into a new month.</p>
  
  <p>What's the easiest method to accomplish this?</p>