Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
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
You can’t perform that action at this time.