note 31255 deleted from language.variables.scope by didou
| From: | didou@php.net | Date: | Mon, 19 Apr 2004 11:15:29 +0000 |
| Subject: | note 31255 deleted from language.variables.scope by didou | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-68325@lists.php.net to get a copy of this message | ||
Note Submitter: Rob
----
The following function allows you to dynamically create a global variable from within a function:
function defineGlobalVariable( $variableName )
{
if( !isset( $GLOBALS[$variableName] ) )
$GLOBALS[$variableName] = null;
}
I know it's not good coding style, but sometimes it can be usefull :-)