RE: [PHP-DB] sorting matrix
| From: | Ford, Mike [LSS] | Date: | Mon, 13 Jan 2003 14:42:44 +0000 |
| Subject: | RE: [PHP-DB] sorting matrix | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-24806@lists.php.net to get a copy of this message | ||
> -----Original Message-----
> From: xxx xxxx [mailto:xde7ori@flash.ro]
> Sent: 13 January 2003 14:25
>
> Hy,
> I have a matrix with strings ex. 4 cols and many rows
> how could I sort the matrix after the 2nd field with
> maintaining the indexes order
>
> Like in a table
>
> name surname age address..
> i have many records and i'd like to print the records in age
> order ascendent or after the surname order...
You need array_multisort(): see http:///www.php.net/array_multisort or http:///ro.php.net/array_multisort (site partially
translated into Romanian, but unfortunately not this page!).
Cheers!
Mike
---------------------------------------------------------------------
Mike Ford, Electronic Information Services Adviser,
Learning Support Services, Learning & Information Services,
JG125, James Graham Building, Leeds Metropolitan University,
Beckett Park, LEEDS, LS6 3QS, United Kingdom
Email: m.ford@lmu.ac.uk
Tel: +44 113 283 2600 extn 4730 Fax: +44 113 283 3211