Array
(
[0] => 2011-10-01
[1] => 2011-11-01
[2] => 2011-12-01
[3] => 2012-01-01
[4] => 2012-02-01
)
show code
<?php
function getNextMonths($date, $numberOfMonths){
$timestamp_now = strtotime($date);
$months[] = date('Y-m-d', $timestamp_now);
for($i = 1;$i <= $numberOfMonths; $i++){
$months[] = date('Y-m-d', (strtotime($months[0].' +'.$i.' month')));
}
print_r($months);
}
getNextMonths('2011-10-1', 4);