php实现的一个税率计算函数
<?php function tax($total,$tax_amount){ $tax_rate = $tax_amount * .01; $tax = $total * $tax_rate; return $value = $tax + $total; } $price = 50.00; #In U.S. Dollars $taxrate = 6.5; #In percentage echo "$".tax($price,$taxrate); ?>
php实现的一个税率计算函数
<?php function tax($total,$tax_amount){ $tax_rate = $tax_amount * .01; $tax = $total * $tax_rate; return $value = $tax + $total; } $price = 50.00; #In U.S. Dollars $taxrate = 6.5; #In percentage echo "$".tax($price,$taxrate); ?>