PHP build an array of an unknown size using date variables
<p>I'm struggling with how to build the following:</p>

<p>result I need:</p>

<pre><code>$months = array();
$months
(
    month[0] = '2011-10-1'
    month[1] = '2011-11-1'
    month[2] = '2011-12-1'
    month[3] = '2012-1-1'
)
</code></pre>

<p>from the following variables:</p>

<pre><code>$date = '2011-10-1';
$numberOfMonths = 4; 
</code></pre>

<p>Any help would be appreciated.</p>

<p>Thanks, guys... all of these solutions work.  I accepted the one that works best for my usage.  </p>
