note 16058 added to language.variables
| From: | michael at NOSPAMmustun dot ch | Date: | Mon, 15 Oct 2001 09:22:23 +0000 |
| Subject: | note 16058 added to language.variables | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-18921@lists.php.net to get a copy of this message | ||
The right synax for PHP 3.x (and 4.x?) is:
$a_global_var = 1;
function a_func() {
//Make everything global local:
while ( list($k,$v) = each($GLOBALS) ) {
if( ! isset($$k) ) {
global $$k;
}
}
print $a_global_var;
}
--
http://www.php.net/manual/en/language.variables.php
http://master.php.net/manage/user-notes.php?action=edit+16058
http://master.php.net/manage/user-notes.php?action=delete+16058
http://master.php.net/manage/user-notes.php?action=reject+16058