GLOBAL vars
Posted: Wed Mar 22, 2006 4:13 pm
I want to set some global variables in the header file in the $_GLOBAL array then be able to use them in a class. heres what i am doing:
header.php
someclass.php
but of course I get the undefined variable. how do I work this situation?
header.php
Code: Select all
$_GLOBAL['sroot'] = 'somthing';Code: Select all
require_once 'header.php';
class some
{
function some()
{
echo $_GLOBAL['sroot'];
}
}