note 29788 deleted from language.references.spot by cece
| From: | cece@php.net | Date: | Mon, 18 Aug 2003 11:20:20 +0000 |
| Subject: | note 29788 deleted from language.references.spot by cece | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-54579@lists.php.net to get a copy of this message | ||
Note Submitter:
----
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);
}