RE: [PHP] How to make an argument optional...confirmation...
| From: | Ralph Guzman | Date: | Fri, 22 Aug 2003 03:20:34 +0000 |
| Subject: | RE: [PHP] How to make an argument optional...confirmation... | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-160382@lists.php.net to get a copy of this message | ||
function test($arg1, $arg2, $arg3 = "")
{
if(isset($arg3))
{
// do whatever with $arg3
}
}
-----Original Message-----
From: Jonathan Villa [mailto:jvilla@isdesigndev.com]
Sent: Thursday, August 21, 2003 7:56 PM
To: php-general@lists.php.net
Subject: [PHP] How to make an argument optional...confirmation...
I want to create a function with an optional argument/parameter but have
never read a concrete answer on how to do it.
This is what I am assuming
function test(arg1,arg2,arg3 = null)
{
arg3 will be optional
}
is this correct?
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php