$arr=array(
[0]=>array(
[username]=>bsmith
[name]=>Bob Smith
)
[1]=>array(
[username]=>mjohnson
[name]=>Mike Johnson
)
[2]=>array(
[username]=>ameyer
[name]=>Meyer Adam
)
)
需要按数组的特定子值自然(按字母顺序)排序。
如果按“用户名”排序 => => ameyer, bsmith, mjohnson
$arr=array(
[0]=>array(
[username]=>ameyer
[name]=>Meyer Adam
)
[1]=>array(
[username]=>bsmith
[name]=>Bob Smith
)
[2]=>array(
[username]=>mjohnson
[name]=>Mike Johnson
)
)
如果按“名称”排序 => bsmith, ameyer, mjohnson
$arr=array(
[0]=>array(
[username]=>bsmith
[name]=>Bob Smith
)
[1]=>array(
[username]=>ameyer
[name]=>Meyer Adam
)
[2]=>array(
[username]=>mjohnson
[name]=>Mike Johnson
)
)
最优雅的方法是什么?
我应该使用uasort吗?