当我打印我的数组时,它给我的是
print_r($out)
给出以下
Array
(
[0] => Organization\System Policies Object
(
[id:protected] => 780
[name:protected] => Apply For all
)
[1] => Organization\System Policies Object
(
[id:protected] => 779
[name:protected] => Apply Critical
)
[2] => Organization\System Policies Object
(
[id:protected] => 781
[name:protected] => Test Machines
)
[3] => Organization\System Policies Object
(
[id:protected] => 782
[name:protected] => Dev Systems
)
)
我尝试使用以下代码对其进行排序
$sorted = array();
foreach ($out as $key => $row)
{
$sorted[$key] = $row['name'];
}
array_multisort($sorted, SORT_ASC, $out);
我尝试使用“名称”对数组进行排序,但收到错误“错误:无法使用组织\系统策略对象类型的对象作为数组”,有没有办法对此进行排序。
饮歌长啸
料青山看我应如是