Re: Arrays past to functions
| From: | Niel Archer | Date: | Fri, 27 Jul 2007 18:03:00 +0000 |
| Subject: | Re: Arrays past to functions | ||
| References: | 1 2 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-28268@lists.php.net to get a copy of this message | ||
Hi Jacob
Sorry, my fault entirely. I wrote it in a hurry after copy/pasting your
example. I didn't change the variable names properly or test it.
I still haven't been able to test, but this should work better now.
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