php二维数组根据price值相加,和大于20的拆分成新的数组
// 请把代码文本粘贴到下方(请勿用图片代替代码)
Array
(
[0] => Array
(
[inventory_type] => 1
[order_goods] => Array
(
[0] => Array
(
[id] => 162646434
[price] => 7.65
[goods_id] => 274774
)
[1] => Array
(
[id] => 162646435
[price] => 12.46
[goods_id] => 445018
)
[2] => Array
(
[id] => 162646436
[price] => 17.00
[goods_id] => 461913
)
[3] => Array
(
[id] => 162646437
[price] => 10.68
[goods_id] => 408752
)
)
)
)
Array
(
[0] => Array
(
[inventory_type] => 1
[order_goods] => Array
(
[0] => Array
(
[id] => 162646434
[price] => 7.65
[goods_id] => 274774
)
[1] => Array
(
[id] => 162646435
[price] => 12.46
[goods_id] => 445018
)
)
)
[1] => Array
(
[inventory_type] => 1
[order_goods] => Array
(
[0] => Array
(
[id] => 162646436
[price] => 17.00
[goods_id] => 461913
)
)
)
[2] => Array
(
[inventory_type] => 1
[order_goods] => Array
(
[0] => Array
(
[id] => 162646437
[price] => 10.68
[goods_id] => 408752
)
)
)
)
九州编程