function foo ($arg1_required, $arg2_options = "") {
if (empty($arg2_optional) {
print "not passed";
} else {
print "explicit";
}
}
Or you can go the other route.
Jordan
"Rodent Of Unusual Size" <[EMAIL PROTECTED]> wrote in message
[EMAIL PROTECTED]">news:[EMAIL PROTE
"Johnson, Kirk" wrote:
>
> http://www.php.net/manual/en/function.func-num-args.php will
> return the number of arguments passed to the function.
Bingo! That will do the trick.. Thanks *very* much!
--
#kenP-)}
Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/
Author, developer, op
bject: Re: [PHP] 'undef' as an argument value
>
>
> Rick Emery wrote:
> >
> > function foo($arg1_required, $arg2_optional="")
> > if ($arg2_optional=="") {
> > print "not passed";
> > }
> > el
Rick Emery wrote:
>
> function foo($arg1_required, $arg2_optional="")
> if ($arg2_optional=="") {
> print "not passed";
> }
> else {
> print "explicit";
> }
> }
No, I said 'undef' because I mean 'undefined'. The argument
can have *any* value; I need to know when
function foo($arg1_required, $arg2_optional="")
if ($arg2_optional=="") {
print "not passed";
}
else {
print "explicit";
}
}
-Original Message-
From: Rodent of Unusual Size [mailto:[EMAIL PROTECTED]]
Sent: Monday, March 11, 2002 3:17 PM
To: [EMAIL PROTECTED
5 matches
Mail list logo