I know this would be an easy one but I don't get it. All answered I found on the net was... too complex to me, maybe.
Here is my typical array:
array(
(int) 0 => array(
'Conversation' => array(
'id' => '1',
'created' => '2012-08-04 00:00:00'
),
'ConversationUser' => array(
(int) 0 => array(
'id' => '1'
),
(int) 1 => array(
'id' => '2'
)
)
),
(int) 1 => array(
'Conversation' => array(
'id' => '2',
'created' => '2012-08-01 00:00:00'
),
'ConversationUser' => array(
(int) 0 => array(
'id' => '1'
),
(int) 1 => array(
'id' => '2'
)
)
));
I want to sort my data with ['Conversation']['created'] date, asc or desc.
Any simple answer ? :P
P.S. I can't use MYSQL sort, I retrieve the data one by one and create that array.
uasort(). You'll just have to code a little function to do the array access and date comparison then.P.S. I can't use MYSQL sort, I retrieve the data one by one and create that array.The two do not contrast each other. You can use MySQL sort and iterate the results one by one to create the array. Please share your query with us.