Last active
November 29, 2018 03:17
-
-
Save KrotovRoman/c8402f1db89d657f2b1c3d228e36c547 to your computer and use it in GitHub Desktop.
сортировка многомерного массива
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| //$res - массив который надо отсортировать по полю in_group | |
| //по возрастанию | |
| usort($res, function($a, $b){ | |
| return ($a['in_group'] - $b['in_group']); | |
| }); | |
| //по убыванию | |
| usort($res, function($a, $b){ | |
| return ($b['in_group'] - $a['in_group']); | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment