<?php
$price = 10;
$tax = 20;
echo "<Br />(Before)Price: \t$price and Tax: \t$tax";
function calcSalesTax(&$price, &$tax){
$price = 40;
$tax = 60;
$total = $price + ($price * $tax);
echo "<Br />(Function Call) Price: \t$price and Tax: \t$tax";
echo "<Br />Total cost: \t$total";
}
calcSalesTax($price, $tax);
echo "<Br />(After) Price: \t$price and Tax: \t$tax";
?>
Categories:
PHP