On Thu, 14 Mar 2002, George Nicolae wrote: >> > <? >> > 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?
Define it somewhere within the global context (i.e., outside of any function. Or do what you have done, refer to it in function b() with the "global" keyword. But you can do that all day long and that won't make it local to function a() unless you modify that function as well. miguel -- PHP General Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php