我有一个数组$data如下
[data] => Array
(
[user1] => Array
(
[score] => 10
)
[user2] => Array
(
[score] => 15
)
[user3] => Array
(
[score] => 12
)
[user4] => Array
(
[score] => 1
)
)
我正在寻找基于分数的数组排名,最高分数为排名 1
输出:
user2 -> 1
user3 -> 2
user1 -> 3
user4 -> 4
有什么建议可以实现吗?