RE: [PHP] Array Problem : Ordering arrays
| From: | Boget, Chris | Date: | Tue, 25 Jul 2000 13:31:12 +0000 |
| Subject: | RE: [PHP] Array Problem : Ordering arrays | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-8033@lists.php.net to get a copy of this message | ||
> Hi PHP gurus!
> I have a PHP problem! I'm sure theres just a single function
> for this, but I can't find it!
> I have an array liek this:
> $stats[Matt] = 13
> $stats[Mark] = 92
> $stats[Mike] = 121
> $stats[Mick] = 7
> How I output to a webpage the rank order of the people i.e.
> Mick : 7
> Matt : 13
> Mark : 92
> Mike : 121
It looks like asort() will solve your problem.
http://www.php.net/manual/function.asort.php
Chris