我有以下数组,数组的每个元素都有一个优先级元素。根据最大优先级值,我们如何生成新数组?
Array
(
[0] => stdClass Object
(
[id] => 1
[name] => Main Category 1
[updated] => 2020-01-14 14:13:30
[priority] => 1
)
[1] => stdClass Object
(
[id] => 2
[name] => Main Category 2
[updated] => 2020-01-14 17:19:35
[priority] => 2
)
[2] => stdClass Object
(
[id] => 3
[name] => Category 3
[updated] => 2020-01-14 17:42:23
[priority] => 3
)
)
因此,此处的最高优先级值为 3。因此,结果数组将如下所示。你能帮帮我吗?提前感谢您。
Array
(
[0] => stdClass Object
(
[id] => 3
[name] => Category 3
[updated] => 2020-01-14 17:42:23
[priority] => 3
)
)
沧海一幻觉