RE: [PHP] Optional parameters in functions....
| From: | Lawrence dot Sheed at dfait-maeci dot gc dot ca | Date: | Fri, 17 Nov 2000 03:19:18 +0000 |
| Subject: | RE: [PHP] Optional parameters in functions.... | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-25857@lists.php.net to get a copy of this message | ||
function name ($one = "", $two="") {
if ($one !="") {
print "one";
}
if ($two !="") {
print "two";
}
}
? name();
? name ("yup");
one
? name ("","yup);
two
? name ("yup","yup");
onetwo
-----Original Message-----
From: John LYC [mailto:john@edlabs.com]
Sent: November 17, 2000 11:17 AM
To: PHP List
Subject: [PHP] Optional parameters in functions....
hey.......
how do i declared a function where parameters are optional???
function name(one,two)....
{
if(one)....
if(two)...
}
when calling,
name(); is still valid....
john
--
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