Array
(
[0] => stdClass Object
(
[id] => 16
[department_id] => 4
[employee_status] => 1
)
[1] => stdClass Object
(
[id] => 17
[department_id] => 8
[employee_status] => 1
)
)
答案 0 :(得分:2)
我找到了一个排序对象数组的解决方案
function cmp($a, $b) {
return $b->department_id - $a->department_id;
}
$sirtedArray=usort($employeelist, "cmp");