RE: [PHP-DB] Sorting a 2 dimension array
| From: | Beau Lebens | Date: | Fri, 05 Oct 2001 08:04:17 +0000 |
| Subject: | RE: [PHP-DB] Sorting a 2 dimension array | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-13028@lists.php.net to get a copy of this message | ||
although i've never used it, sounds like you would need to use the uasort()
function, and write a custom comparison function - tho don't ask me how to
do that :P
HTH
Beau
// -----Original Message-----
// From: John Clarke [mailto:jclarke@premierstateliner.com.au]
// Sent: Friday, 5 October 2001 4:01 PM
// To: php-db@lists.php.net
// Subject: [PHP-DB] Sorting a 2 dimension array
//
//
// I would like to sort a 2 dimensional array based on the
// value of one of the
// keys of each element.
//
// I have an array returned from a msql query which contains 10
// records/elements and each record 5 fields/keys.
// I would like to sort the records based on the value of a
// particular field in
// each record.
//
// Is this possible.? I have looked thru all the array
// functions but cannot
// seem to find anything that allows me to do this.
//
// I dont want to write a separate peice of code to compare all of these
// elements and their values and then place them into a new array in the
// correct order if there is a simpler way of achieving it.
//
// Any comments would be greatly appreciated.
//
// Regards,
//
// John Clarke
//
//
//
// --
// PHP Database Mailing List (http://www.php.net/)
// To unsubscribe, e-mail: php-db-unsubscribe@lists.php.net
// For additional commands, e-mail: php-db-help@lists.php.net
// To contact the list administrators, e-mail:
// php-list-admin@lists.php.net
//