如何根据生成的数据添加费率?以便可以得到总费率数量。
Array
(
[3] => Array
(
[TARIFF] => 0
)
[4] => Array
(
[TARIFF] => 0
)
[2] => Array
(
[TARIFF] => 29500
)
[0] => Array
(
[TARIFF] => 20500
)
[1] => Array
(
[TARIFF] => 14500
)
)
array_sum(array_column($array, 'TARIFF'));
- Mark Bakerarray_reduce($array, function($runningTotal, $value) { $runningTotal += $value['TARIFF']; return $runningTotal; }, 0);
- Mark Baker