-----Original Message-----
From: Ben [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, August 21, 2002 11:25 AM
Subject: [PHP] Sorting a multi-dimensional array

I have looked at array_multisort, asort, etc. NONE of them do what I need.

My array looks like this:

    $array[0][0] = First Id;
    $array[0][1] = First Name;
    $array[0][2] = First Rating;

    $array[1][0] = Second Id;
    $array[1][1] = Second Name;
    $array[1][2] = Second Rating;

    $array[2][0] = Third Id;
    $array[2][1] = Third Name;
    $array[2][2] = Third Rating;

Now, I want to sort the array (very very fast if possible cuz the array is
huge...150 such values) based on the "Rating" for each candidate, which is
the third column inside this matrix array. How should I ask PHP to do this?
Also, when I do sort by the Rating I want the ID and the name to remain the
same for each candidate, i.e., I want the indexes to be maintained.


Thanks in advance

PHP General Mailing List (
To unsubscribe, visit:

PHP General Mailing List (
To unsubscribe, visit:

Reply via email to