Michael, The following is the code taken line for line from Wrox - Beginning PHP - on page 204. ............................................... <? function tax (&$Salary) { $Salary= $Salary - (($Salary/100)*20); return $Salary; } $Salary=2500; echo (tax($Salary)); // This displays $2000 echo $Salary; // This also displays $2000 ?> ........................................
The question really was about the *ampersand* in the argument line which supposedly changes the value of the variable to 2000 from 2500 because of the ampersand symbol. function tax(&$Salary) Thanking all in advance, Tony Ritter ........................................................ Michael Sims <[EMAIL PROTECTED]> wrote in message: > That particular snippet of code *should* echo 2500...because you're not > even calling the function. You're setting the $Salary variable equal to > 2500 and then immediately echoing it... > > Add this line before the last one: > > tax($Salary); > > And it should then echo 2000... > > If you typed it in correctly then the book must have a misprint... ..................................................... -- PHP Windows Mailing List (http://www.php.net/) To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] To contact the list administrators, e-mail: [EMAIL PROTECTED]