List upcoming 12 months since current month

To get upcoming 12 months since current month you can use below code:

$month = date('n'); // current month
for ($m = 0; $m < 12; $m++) {
 echo date('F - Y', mktime(0,0,0,$month + $m,1)) . '<br />';
}

Result:
May - 2013
June - 2013
July - 2013
August - 2013
September - 2013
October - 2013
November - 2013
December - 2013
January - 2014
February - 2014
March - 2014
April - 2014


Tagged , , . Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *