RE: [PHP] using variables in a function within a fuction
| From: | John Holmes | Date: | Tue, 25 Jun 2002 16:09:27 +0000 |
| Subject: | RE: [PHP] using variables in a function within a fuction | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103802@lists.php.net to get a copy of this message | ||
> <?
> function test1()
> {$hello="hello";}
>
> function test2()
> {test1();
> print $hello;}
>
> test2();
>
> ?>
> This should print hello. But it does'nt work. Any idea?
Read here to find out why:
http://www.php.net/manual/en/language.variables.scope.php
---John Holmes...