> I noticed that you have to use keyword "global" in front of globla
> var.- (one declared at the top of a script outside any functions ) in
> order to access it inside a function. So merely designating a var.
> global is a little more involved than say Perl or other languages. You
> actually have to tell PHP that the function is global.
Correct. That is to avoid nasty side-effect bugs where global variables
override local variables in functions. In PHP you need to declare which
global variables you intend to use inside a function. Let's just say I
had a bad experience once related to this and that is why this is so.
You can use $GLOBALS['var_name'] in your function as a workaround if you
don't like declaring which globals you intend to use.
> I see functions , are there subroutine calls. I guess not. A function
> acts as a sub when it returns no value . A sub that returns a value is
> a function.
I see no point in this distinction. And no, PHP just has functions. And
a function doesn't need to return anything.
-Rasmus
--
PHP General Mailing List (http://www.php.net/)
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
To contact the list administrators, e-mail: [EMAIL PROTECTED]