RE: [PHP] Re: function over loading?
| From: | Jason Murray | Date: | Mon, 13 May 2002 02:30:24 +0000 |
| Subject: | RE: [PHP] Re: function over loading? | ||
| Groups: | php.general | ||
| Request: | Send a blank email to php-general+get-97287@lists.php.net to get a copy of this message | ||
> > Can you practice function over-loading in php?
>
> No you cannot overload in PHP.
You can achieve the same effect (having the same function do
something else in a different circumstance) by making
parameters optional:
<?
Function functionName($param1, $param2 = "")
{
...
}
?>
$param1 is required, $param2 is optional - if its not
supplied when the function is called, it will be "".
J