Re: Arrays past to functions
| From: | Niel Archer | Date: | Fri, 27 Jul 2007 16:59:02 +0000 |
| Subject: | Re: Arrays past to functions | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-28264@lists.php.net to get a copy of this message | ||
Hi Jacob
try this:
function compute_salestax ($Amount , $State)
{
$taxRate = array("CA" => 5 , "WA" => 7, "OR" => 8);
return $Amount * $taxRate($state);
}
$payment = 1500;
$locale = 'CA';
print "Tax on $amount in $locale is " . compute_salestax ($payment , $locale);
--
Niel Archer