I have an array like this:
[__DATA] => Array
(
[0] => Array
(
[ID] => 1
[myField] => FALSE
[username] => K
[password] =>
[datetime] => 2003-08-11
)
[1] => Array
(
[ID] => 2
[myField] => FALSE
[username] => X
[password] =>
[datetime] => 2003-09-11
)
[2] => Array
(
[ID] => 3
[myField] => TRUE
[username] => A
[password] =>
[datetime] => 2003-10-11
)
)
What I'd like to do is sort by the "username" value. So, those three arrays, 0, 1, 2, should be re-ordered to 2, 0, 1, because A ( which is the username for record 2 ) comes before K, and K ( which is the username for record 0 ) comes before X, and... etc. etc.
You get the idea.
I have a feeling that array_multisort() is the answer, but I dont understand quite what I'm supposed to supply to this function... I keep getting errors and stuff... maybe I'm just dumb today.
If someone could give me an example it would be much appreciated!