$data = Array (
[0] => stdClass Object ( [ID] => 1 [top_level] => gold [sub_level] => coal )
[1] => stdClass Object ( [ID] => 3 [top_level] => bronze [sub_level] => dirt )
[2] => stdClass Object ( [ID] => 4 [top_level] => silver [sub_level] => aluminum )
)
使用 PHP,我如何排序,例如,通过 [sub_level] 升序(或降序)来生成以下内容?
Array (
[0] => stdClass Object ( [ID] => 4 [top_level] => silver [sub_level] => aluminum )
[1] => stdClass Object ( [ID] => 1 [top_level] => gold [sub_level] => coal )
[2] => stdClass Object ( [ID] => 3 [top_level] => bronze [sub_level] => dirt )
)
此外,在 [sub_level] 中搜索特定值的最有效方法是什么?