Re: global vars within 2-level functions

From: Date: Tue, 02 Apr 2002 19:51:24 +0000
Subject: Re: global vars within 2-level functions
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-91205@lists.php.net to get a copy of this message
On Tue, 2 Apr 2002, Erik Price wrote: > On Tuesday, April 2, 2002, at 01:24 PM, Jason Wong wrote: >>> (b) Pass a variable as an argument to a function but make that argument >>> optional so that it does not have to exist to make the function >>> legitimate. >> >> function function2 ($variable_A="") { >> } > > Thanks for the pointer. I didn't realize that passing a blank argument > would achieve this effect. Here's another way to have optional arguments, just so you're at a wealth of solutions: function function2() { list ($variable_A) = func_get_args(); } miguel

« previous php.general (#91205) next »