I'm going to add an entry to an array, and then want to sort it. Here's the array so far:
the array's name is "$scores"...
Code: Select all
Array
(
[0] => Array
(
[score] => 210
[name] => name
[date] => 03/01/02 4:10pm
[comment] => wow, that game was so much fun!
)
[1] => Array
(
[score] => 100
[name] => name
[date] => 03/01/02 4:10pm
[comment] => i should play it again sometime!
)
[2] => Array
(
[score] => 90
[name] => name
[date] => 03/01/02 4:10pm
[comment] => well, i could have done better...
)
[3] => Array
(
[score] => 10
[name] => name
[date] => 03/01/02 4:10pm
[comment] => none
)
)
then i'm gonna add a new element to that array:
Code: Select all
[4] => Array
(
[score] => 100000
[name] => newname
[date] => 03/09/03 7:40:24pm
[comment] => i beat you all!!
)
now, what i would like to do is sort it by:
$scores[]["score"]]
(in other words, i want to sort it by top scores.)
i've been having lots and lots of problems with it. can i use array_multisort? or not? and if so... how?!
Thank you so much!