note 9619 added to Variables
| From: | CK1 at wwwtech dot de | Date: | Wed, 15 Nov 2000 17:47:03 +0000 |
| Subject: | note 9619 added to Variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-7717@lists.php.net to get a copy of this message | ||
In answer to jb@as220.org:
I think it would be better if you write for php3
reset($GLOBALS);
while(list($k,) = each($GLOBALS))
{ if(!isset(${$k}) global ${$k}; }
or for php4 (I think, even faster)
foreach (array_keys($GLOBALS) as $key)
{ if(!isset(${$key})) global ${$key}; }
http://www.php.net/manual/language.variables.php