gpt4 book ai didi

php - 基于内部数组键值对数组排序

转载 作者:可可西里 更新时间:2023-11-01 13:07:32 25 4
gpt4 key购买 nike

<分区>

我有一个像下面提到的数组

Array
(
[6] => Array
(
[name] => Extras
[total_products] => 0
[total_sales] => 0
[total_affiliation] => 0
)

[5] => Array
(
[name] => Office Products
[total_products] => 7
[total_sales] => 17
[total_affiliation] => 8
)

[1] => Array
(
[name] => Hardware Parts
[total_products] => 6
[total_sales] => 0
[total_affiliation] => 0
)

)

现在,订单是:配件、办公用品、硬件零件

我想对主数组进行排序,使其按降序排列的内部数组的 total_sales 排序

因此订单将是:办公用品、附加用品、硬件零件

大家帮忙

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com