Re: function arguments
| From: | Ben Sinclair | Date: | Fri, 18 Jan 2002 20:19:00 +0000 |
| Subject: | Re: function arguments | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-81145@lists.php.net to get a copy of this message | ||
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...