Re: global



On Wed, 29 Jun 2005 20:35:18 +0000 (UTC), mark <mark@xxxxxxxxxxxxx> wrote:

>$myvar = "test";
>
>function myfunc() {
>global $myvar;
>echo $myvar;
>}
>
>However, when echoing $myvar it is blank. Can anybody tell me what I am
>doing wrong?

Post a runnable piece of code that demonstrates the problem - the one you just
posted does not call the function.

--
Andy Hassall / <andy@xxxxxxxxxxx> / <http://www.andyh.co.uk>
<http://www.andyhsoftware.co.uk/space> Space: disk usage analysis tool
.



Relevant Pages

  • global
    ... function myfunc() { ... global $myvar; ... echo $myvar; ... when echoing $myvar it is blank. ...
    (comp.lang.php)
  • Re: global
    ... Thanks Andy, I was preparing a runable piece of code to post and came across the problem! ... function myfunc() { ... global $myvar; ...
    (comp.lang.php)
  • Custom onbeforeunload traitment
    ... box with layer and div ... ... Nicolas H. ... Prev by Date: ...
    (comp.lang.javascript)
  • Re: Classes without instances
    ... Also sprach Meião: ... > in this first case the function myFunc() will be available without ... > instantiation. ... Prev by Date: ...
    (comp.lang.php)