How to sort a multidimensional array by a certain key?

Posted by Eelke on Stack Overflow See other posts from Stack Overflow or by Eelke
Published on 2010-05-10T17:01:57Z Indexed on 2010/05/10 17:14 UTC
Read the original article Hit count: 192

Filed under:
|
|
|

This should be really simple, but what is the way to go on this. I want to sort an multidimensional array by a key, like this:

Array (
[0] => Array
    (
        [iid] => 1
        [invitee] => 174
        [nid] => 324343
        [showtime] => 2010-05-09 15:15:00
        [location] => 13
        [status] => 1
        [created] => 2010-05-09 15:05:00
        [updated] => 2010-05-09 16:24:00
    )

[1] => Array
    (
        [iid] => 1
        [invitee] => 220
        [nid] => 21232
        [showtime] => 2010-05-09 15:15:00
        [location] => 12
        [status] => 0
        [created] => 2010-05-10 18:11:00
        [updated] => 2010-05-10 18:11:00
    ))

Say i want to sort this by [status], how would I achieve this? Thanks in advance!

© Stack Overflow or respective owner

Related posts about php

Related posts about sort