我有下面的数组,需要一些额外的结构。
Array
(
[-Others] => Array
(
[0] => Array
(
[products_sold] => 1
[products_total_sales] => 2.99
[products_total_costs] => 1.75
[products_total_profit] => 1.24
)
[1] => Array
(
[products_sold] => 1
[products_total_sales] => 2.3322
[products_total_costs] => 1.75
[products_total_profit] => 0.5822
)
)
[Addict] => Array
(
[0] => Array
(
[products_sold] => 1
[products_total_sales] => 35.1
[products_total_costs] => 40
[products_total_profit] => -4.9
)
很明显,我已经提前截断了。我想知道是否可以将所有子产品的所有销售额加起来,products_total_sales
每个品牌(又名addict
)
我想在它们被解析之前得到它,比如:
[Addict] => Array
(
[0] => Array
[brand_total_sales] => '$value'
(
[products_sold] => 1
...
任何帮助是极大的赞赏。提前致谢,如果您需要更多信息,请随时询问