我有一个数组
<?php
$arr = [
['price'=>100, 'rank'=>3],
['price'=>55000, 'rank'=>4],
['price'=>500, 'rank'=>5],
['price'=>130, 'rank'=>3],
['price'=>25000, 'rank'=>4],
['price'=>50000, 'rank'=>4],
['price'=>120, 'rank'=>3],
['price'=>1000, 'rank'=>5],
];
我希望它首先按排名按降序分组,然后在该组中按价格按降序排列。
['price'=>1000, 'rank'=>5],
['price'=>500, 'rank'=>5],
['price'=>55000, 'rank'=>4],
['price'=>50000, 'rank'=>4],
['price'=>25000, 'rank'=>4],
['price'=>130, 'rank'=>3],
['price'=>120, 'rank'=>3],
['price'=>100, 'rank'=>3],
我尝试使用带有太空船操作符的 uasort 函数,但我无法成功。