04-15-2008, 06:12 PM
|
#3 (permalink)
|
|
La Vida es Sueño
Join Date: Sep 2007
Location: Oldham
Posts: 2,280
Thanks: 90
|
The only segment that I have modified is assigned the value of the salestax function to the $nYourtotal variable. When you issue the return in your custom function, that simply returns data back, and so you can either assign (as in our case), print (as we do later on when we print), or do nothing with (as you were doing previously).
php Code:
// Charge for an item.$nCharge = 100. 00 ; // Define the function.function salestax ($nCharge, $nShip = . 10){ $nYourtotal = ($nCharge + ($nCharge * $nShip)); return $nYourtotal ; }// Invoke the function...$nYourtotal = salestax ($nCharge) ; // Print the results...print $nYourtotal ;
__________________
The man who comes back through the Door in the Wall will never be quite the same as the man who went out.
|
|
|