Re: [PHP] optional argument when creating a function

2005-08-17 Thread Jordan Miller
apparently the ampersand means to treat $link as a reference, not as an optional argument: http://www.softwareprojects.org/php-functions-12.htm I think the way to do it would be to set a default value in your function so that if a value is set by the calling statement that would override it

Re: [PHP] optional argument when creating a function

2005-08-17 Thread John Nichel
D A GERM wrote: I'm throwing a warning on a function I created. I thought a & in front of the argument was supposed to make it optional. Is there something else I need to do make that argument optional? The ampersand does not make it optional. It passes it by reference... http://us2.php.net/ma

[PHP] optional argument when creating a function

2005-08-17 Thread D A GERM
I'm throwing a warning on a function I created. I thought a & in front of the argument was supposed to make it optional. Is there something else I need to do make that argument optional? //I simplified the code function doEmail($username, &$link) { if (isset($link)) { print "$link $user