note 27675 deleted from language.references.spot by sniper
| From: | sniper@php.net | Date: | Tue, 30 Sep 2003 01:26:46 +0000 |
| Subject: | note 27675 deleted from language.references.spot by sniper | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-57355@lists.php.net to get a copy of this message | ||
Note Submitter: sovok@gmx.de
----
if you don't want to write "global" in every single function, write the following
function:
function g($varname) {
global $$varname;
return $$varname;
}
Now you can access your variables in every function this way:
$myvar = "noglobal"
function example() {
echo g(myvar);
}