PHP 按项目数对多维数组进行排序
我有一个数组,例如:
Array
(
[DEF] => Array
(
[0] => Array
(
[type] => 1
[id] => 1212
[name] => Jane Doe
[current] => 1
)
[1] => Array
(
[type] => 1
[id] => 3123121
[name] => Door
[current] =>
)
)
[ABC] => Array
(
[0] => Array
(
[type] => 1
[id] => 1234
[name] => John Doe
[current] =>
)
)
[WW] => Array
(
[0] => Array
(
[type] => 1
[id] => 1212
[name] => Jane Doe
[current] => 1
)
[1] => Array
(
[type] => 1
[id] => 3123121
[name] => Door
[current] =>
)
[2] => Array
(
[type] => 1
[id] => 64646
[name] => Floor
[current] =>
)
)
)
我想按内部数组项目降序(即大多数项目优先)的数字(count())对这个数组进行排序,所以我将有这个数组:
Array
(
[WW] => Array
(
[0] => Array
(
[type] => 1
[id] => 1212
[name] => Jane Doe
[current] => 1
)
[1] => Array
(
[type] => 1
[id] => 3123121
[name] => Door
[current] =>
)
[2] => Array
(
[type] => 1
[id] => 64646
[name] => Floor
[current] =>
)
)
[DEF] => Array
(
[0] => Array
(
[type] => 1
[id] => 1212
[name] => Jane Doe
[current] => 1
)
[1] => Array
(
[type] => 1
[id] => 3123121
[name] => Door
[current] =>
)
)
[ABC] => Array
(
[0] => Array
(
[type] => 1
[id] => 1234
[name] => John Doe
[current] =>
)
)
)
任何人都可以提出一种有效的方法来做到这一点吗?谢谢。