Re: using variables in a function within a fuction
| From: | Michael P. Carel | Date: | Tue, 25 Jun 2002 05:48:34 +0000 |
| Subject: | Re: using variables in a function within a fuction | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-103722@lists.php.net to get a copy of this message | ||
thanks
> <?
> function test1()
> {return "hello";}
>
> function test2()
> {$hello = test1();
> print $hello;}
>
> test2();
>
> ?>
>
> or make it (argh) global
>
> -----Original Message-----
> From: Michael P. Carel [mailto:mikecarel@teamglac.com]
> Sent: Tuesday, June 25, 2002 3:14 PM
> To: php
> Subject: [PHP] using variables in a function within a fuction
>
>
> Hi to all,
> Have problem with this. Im want to use a variable in a function into
another
> function. such as:
>
> <?
> function test1()
> {$hello="hello";}
>
> function test2()
> {test1();
> print $hello;}
>
> test2();
>
> ?>
> This should print hello. But it does'nt work. Any idea?
>
> Regards
> mike
>
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php
>
> --
> PHP General Mailing List (http://www.php.net/)
> To unsubscribe, visit: http://www.php.net/unsub.php