On Mon, 1 Apr 2002, Jordan K. Martin wrote:
> Makes sense.  I didn't think much when writing that piece...but...what is
> the & for?  wouldn't it work the same without it?
> function test ($var)
> {
>     $var = addslashes($var)
> }
>  $foo = "He's dreaming";
>  test($foo);
>  print($foo);

If you don't have the & in the function declaration, then the function
operates on a copy of the variable. This is normally more useful, when you
don't want functions messing with your variables, but instead doing things
with them to produce new information (which you get back via return).


PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to