[thelist] including $variables in php

Joxn joxn at vernum.com
Thu Sep 21 09:32:18 CDT 2000


Adrian Fischer wrote:
> So that I dont have to hard code colours of tables and other
> things I used $variables to define them once and then used said variables.
> Can I do the same in php?  I tried using the "include('variable.php3')" but
> nothing happens.

The problem is the scope of the variables in PHP.
While in Perl everything is global, except you up a "my" infront of it
eg. in the function, in PHP everything is local except you put a
"global" infront of it.
Take a look a this page:
http://www.php.net/manual/language.variables.scope.php

Probably you could use constants, too.
http://www.php.net/manual/language.constants.php

HTH,
bye Joxn
-- 
   || //\\ \\// |\\||  ::  joxn at vernum.com  ::
 \\|| \\// //\\ ||\\|  ::      8053703      ::




More information about the thelist mailing list