Re: Sort an array by its values
| From: | Chris Lambert - WhiteCrown Networks | Date: | Sun, 08 Jul 2001 08:33:16 +0000 |
| Subject: | Re: Sort an array by its values | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-56734@lists.php.net to get a copy of this message | ||
Do you mean something like www.php.net/ksort or www.php.net/krsort?
I'm not sure of the actual structure of your array, though, so those might
not work as expected.
/* Chris Lambert, CTO - chris@whitecrown.net
WhiteCrown Networks - More Than White Hats
Web Application Security - www.whitecrown.net
*/
----- Original Message -----
From: Aaron Bennett <abennett@liquidstudio.com>
To: Php-General (E-mail) <php-general@lists.php.net>
Sent: Sunday, July 08, 2001 4:25 AM
Subject: [PHP] Sort an array by its values
| Hi All,
| I'm trying to sort an array of objects by the value of one of those
| objects...
| for instance, I'll have an object with 2 properties, "id" and "score",
where
| id is unique and score is its relevant (and sometimes simelar) score. i've
| tried using sort() and asort() but i can't figure how to base the sorting
| off the value (i.e. score) of the object in the array. Any help?
| --
| Aaron
|