本文實(shí)例講述了php實(shí)現(xiàn)的簡(jiǎn)單美國(guó)商品稅計(jì)算函數(shù)。分享給大家供大家參考。具體如下:
<?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);
?>
希望本文所述對(duì)大家的php程序設(shè)計(jì)有所幫助。
新聞熱點(diǎn)
疑難解答
圖片精選