sorting array question
| From: | Angelo Zanetti | Date: | Wed, 26 Jul 2006 13:17:55 +0000 |
| Subject: | sorting array question | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-239804@lists.php.net to get a copy of this message | ||
Hi all,
Need some advice as to how to sort a array:
Structure:
partnerID
partnerName
total
totalPaid
totalUnpaid
So basically there will be many entries for the following:
eg:
partnerID | partnerName | total | totalPaid | totalUnpaid
1 marc 12 5 7 5 berty 30 12 18 7 sarah 19 12 7 So they way I want to sort these rows is by total, totalPaid, totalUnpaid all descending.Output should be: partnerID | partnerName | total | totalPaid | totalUnpaid
5 berty 30 12 18 7 sarah 19 12 7 1 marc 12 5 7I have looked at the manual and found uasort and array_multisort, but these don't seem to be appropriate unless Im missing something but the examples found are very vague. If anyone can help that would be great, Thanks in advance Angelo ------------------------------------------------------------------------ Angelo Zanetti Systems developer ------------------------------------------------------------------------ *Telephone:* +27 (021) 469 1052
*Mobile:* +27 (0) 72 441 3355 *Fax:* +27 (0) 86 681 5885* Web:* http://www.zlogic.co.za *E-Mail:* angelo@zlogic.co.za <mailto:jerry@zlogic.co.za>