Re: Optional parameters in functions....
| From: | jeremy brand | Date: | Fri, 17 Nov 2000 03:17:50 +0000 |
| Subject: | Re: Optional parameters in functions.... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-25855@lists.php.net to get a copy of this message | ||
function ($value1, $optional_value_2='default_value')
{
return TRUE;
}
You have to set the values that you want to make optional to have
default values (see above).
-jeremy brand
http://www.JeremyBrand.com/Jeremy/Brand/Jeremy_Brand.html
for more
---------------------------------------------------------------------
We cannot do everything at once, but we can do something at once.
-- Calvin Coolidge
> 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
>
>