I have an array in following format:
array(
[0]=> array(
[0]=> array (
["ID"]=> 118
["post_date"]=> "2014-04-28 07:27:37"
["post_title"]=> "Title 1"
)
[1]=> array (
["ID"]=> 119
["post_date"]=> "2014-04-29 07:27:37"
["post_title"]=> "title 2"
)
)
[1]=> array(
[0]=> array (
["ID"]=> 135
["post_date"]=> "2014-04-28 06:37:37"
["post_title"]=> "Title 3"
)
[1]=> array (
["ID"]=> 148
["post_date"]=> "2014-04-25 07:27:37"
["post_title"]=> "Title 4"
)
)
[2]=> array(
[0]=> array (
["ID"]=> 135
["post_date"]=> "2014-04-24 06:37:37"
["post_title"]=> "Title 5"
)
[1]=> array (
["ID"]=> 148
["post_date"]=> "2014-04-25 09:21:37"
["post_title"]=> "Title 6"
)
)
)
Now I need to sort this using post_date and show them in DESC order. This is in PHP.
I am not sure how to sort this. Can anybody please help me with this sorting?
This is how I want to show the output:
title 2
Title 1
Title 3
Title 6
Title 4
Title 5
post_date" - whichpost_date? Each array element ultimately contains two, which appear to differ unpredictably.post_dates of the flattened array? This is really two operations that need to be composed together. The flattening step can be accomplished using a loop. The sorting can be achieved using Petah's answer to the question linked by Nazin.