Re: Function Var or No Var
| From: | Hsieh Wen-Yang | Date: | Fri, 05 Jan 2001 11:48:16 +0000 |
| Subject: | Re: Function Var or No Var | ||
| References: | 1 2 3 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-32871@lists.php.net to get a copy of this message | ||
function functionname($arg=dafaultvalue) {
....
}
----- Original Message -----
From: "Abe Asghar" <abe@fish.tm>
To: "PHP LIST" <php-general@lists.php.net>
Sent: Friday, January 05, 2001 3:42 AM
Subject: [PHP] Function Var or No Var
Hey guys,
I have a function in an external file. It is a footer function and is
called on many pages. Now I want to pass it a varible from only one or two
pages. However the problem is that I want to pass it a variable from one
page and not from other pages e.g.
1.
DisplayFooter();
and
2.
DisplayFooter($currentpage);
The function is set up to recieve the variable - doing this I get a warning
message where it is not sent a variable as in example 1.
Is there a way to have a function that can take a variable and not produce
an error or have a default value if not sent a varible or value.
Thanks for any help.
Abe
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net
For additional commands, e-mail: php-general-help@lists.php.net
To contact the list administrators, e-mail: php-list-admin@lists.php.net