Re: Re: make global variables accessible to functions?

From: Date: Fri, 07 Apr 2006 23:58:39 +0000
Subject: Re: Re: make global variables accessible to functions?
References: 1 2 3  Groups: php.general 
Request: Send a blank email to php-general+get-233508@lists.php.net to get a copy of this message
At 12:35 PM -0500 4/7/06, Bing Du wrote:
Thanks for the response.
That way is secure and has nothing to do with register_globals ;)
Good. That's what I wanted to hear. I know by default some pre-defined global variables can be accessed through $GLOBALS. If I don't want end users to add their own user defined variables in the superglobal area, how should I do that?
What you can do too is this: <?php function foo($a) { echo "a is $a"; } ?>
Yeah, I know it works this way. The reason I don't go this way is I have quite a few variables that need to be passed to the function, it's not feasible to pass all them as funtion parameters. Bing
Bing: Then pass them as an array by reference. I seldom use Globals. tedd -- -------------------------------------------------------------------------------- http://sperling.com

« previous php.general (#233508) next »