【发布时间】:2012-06-25 12:18:13
【问题描述】:
我想按键值对如下所示的数组进行排序:
$arr = ([0]=>Int(5)
[1]=> Array ( [0]=>Int(4) , [1]=>String(10) , [2]=>String(22) , ['prop']=>Int(2))
[2]=> Array ( [0]=>Int(4) , [1]=>String(10) , [2]=>String(22) , ['prop']=>Int(2))
[3]=> Array ( [0]=>Int(4) , [1]=>String(10) , [2]=>String(22) , ['prop']=>Int(2))
)
因此,我希望 $arr 按 ['prop'] 的值排序。
我试过冒泡排序,但没有任何结果。
【问题讨论】:
-
看看usort()
-
提问前请使用搜索功能。
-
@Jeroen 我已经尝试过 usort() 并在执行时超时!