Re: global $GLOBALS ??? 2nd...

From: Date: Thu, 12 Oct 2000 08:25:36 +0000
Subject: Re: global $GLOBALS ??? 2nd...
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-19778@lists.php.net to get a copy of this message
At 09:44 12-10-00 +0200, Berthold Tenhumberg wrote:
Is there a way to get all global variables in a function readable? For example: 1 function bla() {
2    global $GLOBALS;
3    echo $my_global_var;
4 }
Hiya Dirty but works, But why won't you just use global $var name.... this is *alot* of overhead: function Bla () {
        foreach($GLOBALS AS $name => $value) {
                $$name = $value;
        }
        ho $my_global_var;
} Greetz, Wico
Line 2 is not working... Why? -- Berthold Tenhumberg (live long and prosper...) -- PHP General Mailing List (http://www.php.net/) To unsubscribe, e-mail: php-general-unsubscribe@lists.php.net For additional commands, e-mail: php-general-help@lists.php.net To contact the list administrators, e-mail: php-list-admin@lists.php.net


« previous php.general (#19778) next »