Re: Function misfunction - 2

From: Date: Tue, 31 Dec 2002 14:06:37 +0000
Subject: Re: Function misfunction - 2
References: 1 2 3 4  Groups: php.general 
Request: Send a blank email to php-general+get-129772@lists.php.net to get a copy of this message
Jason Wong wrote: > If you want it so that the value of $lookuptable (in the global scope) is > changed when you call your function then you have to do something like: > > <?php > function doo($dah, $dee, $etc) { > global $lookuptable; > $lookuptable = "Hello world"; > } > > doo(1, 2, 3); > echo $lookuptable; // prints "Hello world" > ?> > > More examples in manual > Variables > Variable scope Yes. I tried that (or rather global $adb, $lookuptable) at one point as that seemed the most natural remedy. It didn't work so I abandoned it. Perhaps I did something else stupid. I'll re-read the docs. Thanks for your help, and Happy New Year! Martin S.

« previous php.general (#129772) next »