function getTotal($products_costs, $tax){ $total = 0.00; $callback = function ($pricePerItem) use ($tax, &$total) { $total += $pricePerItem * ($tax + 1.0); }; array_walk($products_costs, $callback); return round($total, 2);}
本文共 288 字,大约阅读时间需要 1 分钟。
function getTotal($products_costs, $tax){ $total = 0.00; $callback = function ($pricePerItem) use ($tax, &$total) { $total += $pricePerItem * ($tax + 1.0); }; array_walk($products_costs, $callback); return round($total, 2);}
转载地址:http://jezxl.baihongyu.com/