Re: quick globalisation?
| From: | Justin French | Date: | Tue, 24 Aug 2004 02:21:03 +0000 |
| Subject: | Re: quick globalisation? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-194549@lists.php.net to get a copy of this message | ||
Jay,
"global $a, $b, $c" is used for bringing global variables INTO the scope of the function... what I'm after is a way of making localised variables (in function) available outside of the function.
Justin
On 24/08/2004, at 1:38 AM, Jay Blanchard wrote:
[snip] Is there a quicker way to globalise something other than: $a = 'foo'; $b = 'bah'; ... $GLOBALS['a'] = $a; $GLOBALS['b'] = $b; ?? I was hoping for something like $a = 'foo'; $b = 'bah'; ... makeGlobal('a','b') /*or*/ makeGlobal($a,$b); [/snip] According to http://us3.php.net/language.variables.scope you could do something like global $a, $b, $c, ...;--- Justin French http://indent.com.au