Skip to content

Instantly share code, notes, and snippets.

@SBaof
Created May 25, 2017 06:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SBaof/b3c7d90d43347c0ed87c5f51c84126f4 to your computer and use it in GitHub Desktop.
Save SBaof/b3c7d90d43347c0ed87c5f51c84126f4 to your computer and use it in GitHub Desktop.
PHP: 二维数组排序
待排数组:
```
$user = [
[
'name' => 'tom',
'age' => 10,
],
[
'name' => 'Jim',
'age' => 9,
],
[
'name' => 'Janne',
'age' => 18,
]
]
```
usort ($user, function($a, $b) {
return $a.age - $b.age;
})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment