PHP|一段Code

niecprea
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);
}
阅读 1.4k

ThinkingPool
Y1RReE5qazFOVFl5

Hello world!

859 声望
54 粉丝
0 条评论
你知道吗?

Hello world!

859 声望
54 粉丝
宣传栏