note 23925 deleted from language.variables.predefined by curt
| From: | curt@php.net | Date: | Tue, 06 Jul 2004 02:57:25 +0000 |
| Subject: | note 23925 deleted from language.variables.predefined by curt | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-72657@lists.php.net to get a copy of this message | ||
Note Submitter: jim.dam@cogeco.ca
----
If you set a variable with $GLOBALS, you can still refer to it as just $variablename. That is, if
in your script you put the following code:
--
<?PHP
$GLOBALS['variable_name'] = 'variable_value';
echo $variable_name; // echoes 'variable_value'
?>
--
This isn't too unexpected, but the documentation didn't clearly state this either.
However if your variable_name includes a space or starts with a number, you cannot access it (as far
as I know), except with using the $GLOBALS array.