"Jason Wong" <[EMAIL PROTECTED]> wrote in message
news:[EMAIL PROTECTED]...
> On Thursday 14 March 2002 21:53, George Nicolae wrote:
> > I have the following code:
> >
> > <?
> > function a($var_a)
> > {
> > b();
> > }
> >
> > function b()
> > {
> > global $var_a;
> > echo $var_a;
> > }
> >
> > a("hello word!");
> > ?>
> >
> > why function b() don't echo anything?
>
> Because $var_a has not, at any point, been defined in the global scope.

how i declare $var_a as global?

> > can I resolve this problem without
> > calling b($var_a)?
>
> I'm curious as to what you're trying to achieve. Could you enlighten me?

I have a big(=many lines) function "a()" and a little one "b()". I call
function "b()" from function "a()" and alsow from many other php files. I
need to midify the function "b()" without modify any other php files. That's
why I don't want to use b($var_a).

> --
> Jason Wong -> Gremlins Associates -> www.gremlins.com.hk
> Open Source Software Systems Integrators
> * Web Design & Hosting * Internet & Intranet Applications Development *
>
> /*
> "I will make no bargains with terrorist hardware."
> -- Peter da Silva
> */


Best regards,
George Nicolae
IT Manager
___________________
PaginiWeb.com  - Professional Web Design
www.PaginiWeb.com



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to