Re: function arguments
| From: | mike cullerton | Date: | Fri, 18 Jan 2002 20:43:49 +0000 |
| Subject: | Re: function arguments | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81148@lists.php.net to get a copy of this message | ||
expanding on this...
function func($arga, $argb, $argc='') {
do_something_with_arga($arga);
do_another_thing_with_argb($argb);
if ($argc != '') do_somthing_with_argc($argc);
}
on 1/18/02 1:19 PM, Ben Sinclair at ben@yourwebwill.com wrote:
> You can do something like this:
>
> function myFunction($a = "hello", $b = "world") { }
>
> Both arguments are optional and have default values. This is in the
> documentation.
>
> --
> Ben Sinclair
> ben@yourwebwill.com
> ----- Original Message -----
> From: "Malte Fucks" <der_diggen@gmx.net>
> To: <php-general@lists.php.net>
> Sent: Thursday, January 18, 2001 2:17 PM
> Subject: [PHP] function arguments
>
>
> Hi, how do i tell a function which arguments can be passed and which must be
> passed...
>
> example:
> function func($arga, $argb, $argc)
> {
> do_something_with_arga;
> do_another_thing_with_argb;
> and_if_argc_was_passed_do_something_with_it_too;
> }
>
> because i dont want to pass argc if i dont need it, and to pass void arguments
> like '' is annoying...
>
>
-- mike cullerton michaelc at cullerton dot com