note 14049 rejected and deleted from function.array-multisort.php by zak
| From: | zak@php.net | Date: | Wed, 25 Jul 2001 17:13:14 +0000 |
| Subject: | note 14049 rejected and deleted from function.array-multisort.php by zak | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-15838@lists.php.net to get a copy of this message | ||
To sort a multi-dimensional array according to a certain column, I use the follwing code:
// [x] = column to sort by (starts at 0)
foreach($array as $v) $s[] = $v[1];
// sort with array_multisort() options
array_multisort($s, SORT_ASC, $array);