RE: [PHP] 'undef' as an argument value

From: Date: Mon, 11 Mar 2002 21:18:48 +0000
Subject: RE: [PHP] 'undef' as an argument value
Groups: php.general 
Request: Send a blank email to php-general+get-88091@lists.php.net to get a copy of this message
http://www.php.net/manual/en/function.func-num-args.php will return the number of arguments passed to the function. Kirk > -----Original Message----- > From: Rodent of Unusual Size [mailto:Ken.Coar@Golux.Com] > Sent: Monday, March 11, 2002 2:25 PM > To: php-general@lists.php.net > Subject: Re: [PHP] 'undef' as an argument value > > > 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 it has *none*. That > is, there is no magic cookie to which I can set the default that > might not be a valid call value. > -- > #ken P-)} > > Ken Coar, Sanagendamgagwedweinini http://Golux.Com/coar/ > Author, developer, opinionist http://Apache-Server.Com/

« previous php.general (#88091) next »