Re: How to make an argument optional...confirmation...
| From: | Tom Rogers | Date: | Fri, 22 Aug 2003 03:20:53 +0000 |
| Subject: | Re: How to make an argument optional...confirmation... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160383@lists.php.net to get a copy of this message | ||
Hi,
Friday, August 22, 2003, 12:55:37 PM, you wrote:
JV> I want to create a function with an optional argument/parameter but have
JV> never read a concrete answer on how to do it.
JV> This is what I am assuming
JV> function test(arg1,arg2,arg3 = null)
JV> {
JV> arg3 will be optional
JV> }
JV> is this correct?
Yes that is correct, you don't have to use null any value can be put
in as a default.
--
regards,
Tom