note 45487 added to language.variables.scope
| From: | pulstar at ig dot com dot br | Date: | Thu, 09 Sep 2004 01:02:42 +0000 |
| Subject: | note 45487 added to language.variables.scope | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-76257@lists.php.net to get a copy of this message | ||
If you need all your global variables available in a function, you can use this:
<?php
function foo(parameters) {
if(version_compare(phpversion(),"4.3.0")>=0) {
foreach($GLOBALS as $arraykey=>$arrayvalue) {
global $$arraykey;
}
}
// now all global variables are locally available...
}
?>
----
Manual Page -- http://www.php.net/manual/en/language.variables.scope.php
Edit -- http://master.php.net/manage/user-notes.php?action=edit+45487
Delete -- http://master.php.net/manage/user-notes.php?action=delete+45487&report=yes
Reject -- http://master.php.net/manage/user-notes.php?action=reject+45487&report=yes
Search -- http://master.php.net/manage/user-notes.php