note 126491 added to function.array-multisort
| From: | 498936940 at qq dot com | Date: | Sat, 09 Oct 2021 03:00:46 +0000 |
| Subject: | note 126491 added to function.array-multisort | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-217051@lists.php.net to get a copy of this message | ||
Arbitrarily sort the two-dimensional array according to multiple keys:
```
array_multisort (
array_column($array, 'key1'), SORT_ASC,
array_column($array, 'key2'), SORT_DESC,
array_column($array, 'key3'), SORT_ASC,
array_column($array, 'key4'), SORT_DESC,
$array
);
```
----
Server IP: 45.112.84.4
Probable Submitter: 45.112.85.242 (proxied: 180.110.31.221)
----
Manual Page -- https://php.net/manual/en/function.array-multisort.php
Edit -- https://main.php.net/note/edit/126491
Del: integrated -- https://main.php.net/note/delete/126491/integrated
Del: useless -- https://main.php.net/note/delete/126491/useless
Del: bad code -- https://main.php.net/note/delete/126491/bad+code
Del: spam -- https://main.php.net/note/delete/126491/spam
Del: non-english -- https://main.php.net/note/delete/126491/non-english
Del: in docs -- https://main.php.net/note/delete/126491/in+docs
Del: other reasons-- https://main.php.net/note/delete/126491
Reject -- https://main.php.net/note/reject/126491
Search -- https://main.php.net/manage/user-notes.php