基本上我有如下设置:
Array (
[0] => Array ( [0] => stdClass Object ( [nid] => 1 [title] => title1 [uid] => 1 [parent] => 0 [weight] => -15 [name] => name1 [value] => 0 )
[1] => stdClass Object ( [nid] => 2 [title] => title2 [uid] => 1 [parent] => 0 [weight] => -7 [name] => name2 [value] => 100 )
[2] => stdClass Object ( [nid] => 3 [title] => title3 [uid] => 2 [parent] => 0 [weight] => -1 [name] => name3 [value] => 0 )
[3] => stdClass Object ( [nid] => 4 [title] => title4 [uid] => 2 [parent] => 0 [weight] => 1 [name] => name4 [value] => 80 )
)
)
我需要的是一种通过对象中的 [value] 键对父数组中的所有数组进行排序的方法。我已经用 usort 和不同的方法尝试了大约 2 天,但我似乎无法理解它。[value] 键的范围从 0 到 100,我需要按降序排序的所有数组(即:100 到 0)。