PHP to get previous 12 months

by Subramanian 2013-07-25 13:17:35

PHP to get previous 12 months


for ($t = 1; $t <= 12; $t++) {
echo date("F Y m", strtotime( date( 'Y-m-01' )." -$t months"));
}


Output of this code is :

June 2013 06
May 2013 05
April 2013 04
March 2013 03
February 2013 02
January 2013 01
December 2012 12
November 2012 11
October 2012 10
September 2012 09
August 2012 08
July 2012 07
850
like
0
dislike
0
mail
flag

You must LOGIN to add comments