Re: globals

From: Date: Sat, 16 Dec 2000 17:43:34 +0000
Subject: Re: globals
References: 1  Groups: php.db 
Request: Send a blank email to php-db+get-5291@lists.php.net to get a copy of this message
Date sent: Sat, 16 Dec 2000 01:18:39 -0700 (MST) From: John Starkey <jstarkey@advancecreations.com> To: php-db@lists.php.net Subject: globals > Hello all. > > What are the rules for globals? I've seen them in tutorials but have had a > hard time implementing them. I need to create an array outside of a > function, pass a variable to that function, and then call the array for > comparison to that variable. I can't pass the array to the function. > there's nothing special about globals. It's for globalising variables defined outside of a function. i think you dont need it. to pass use: my_function ($var); try "echo $var" inside the function to make sure that it has been passed. notice: If you want your function to be able to change your $var , make a "call by reference" (see the manual for that, sorry) jyrgen

« previous php.db (#5291) next »