我有一个嵌套关联数组,如下所示,需要帮助为每个键(例如“first_name”和“score”)对数组进行排序。
例如:
Array
(
[12345] => Array
(
[75] => Array
(
[first_name] => Xen
[score] => 245
)
)
[9876] => Array
(
[75] => Array
(
[first_name] => Shane
[score] => 300
)
)
[4567] => Array
(
[75] => Array
(
[first_name] => Dan
[score] => 100
)
)
)
结果应该具有按键升序排序的数组:
Array
(
[first_name] => Array
(
[0] => 4567
[1] => 9876
[2] => 12345
)
[score] => Array
(
[0] => 4567
[1] => 12345
[2] => 9876
)
)