Possible Duplicate:
Sorting multidimensional array in PHP
How can I sort by key in a multidimensional array?
For instance, below is the array I print from my db, where the latest comes first - December, November, October, etc and 2011, 2010, 2009, etc
Array
(
[0] => Array
(
[URL] => september 2011
[Title] => September 2011
[Date] => 8
[Month] => 9
[Year] => 2011
)
[1] => Array
(
[URL] => january 2011
[Title] => January 2011
[Date] => 1
[Month] => 2
[Year] => 2011
)
[2] => Array
(
[URL] => february 2011
[Title] => February 2011
[Date] => 4
[Month] => 1
[Year] => 2011
)
[3] => Array
(
[URL] => november 2011
[Title] => November 2011
[Date] => 23
[Month] => 11
[Year] => 2010
)
[4] => Array
(
[URL] => april 2011
[Title] => April 2011
[Date] => 23
[Month] => 4
[Year] => 2010
)
)
But I need it to be like this, October, November, December, etc and 2011, 2010, 2009, etc - note the months are sorted by the oldest comes first but the years are still sorted by the latest comes first.
So the array should be sorted like this,
Array
(
[2] => Array
(
[URL] => february 2011
[Title] => February 2011
[Date] => 4
[Month] => 1
[Year] => 2011
)
[1] => Array
(
[URL] => january 2011
[Title] => January 2011
[Date] => 1
[Month] => 2
[Year] => 2011
)
[0] => Array
(
[URL] => september 2011
[Title] => September 2011
[Date] => 8
[Month] => 9
[Year] => 2011
)
[4] => Array
(
[URL] => april 2010
[Title] => April 2010
[Date] => 23
[Month] => 4
[Year] => 2010
)
[3] => Array
(
[URL] => november 2010
[Title] => November 2010
[Date] => 23
[Month] => 11
[Year] => 2010
)
)
Is that possible?