Hi All,
Just a quick question about structure.
I had a script that looked comething like this…
[code=php]//declare globals
global $test, $g1, $g2, $path
//use the globals
$g1 = “something”
//include a fragment
include(setup.inc.php”);//uses the global $test
I’ve changed it to this…
[code=php]//get global declaration
include(“globals.inc.php”);
//use the globals
$g1 = “something”
//include a fragment
include(setup.inc.php”);//uses the global $test
In other words, I’ve moved the global declaration into a scriptlet that I’m including. It seems to work, but because all I’m doing is setting globals, it will appear to work anyway, except that the end result might be unstable.
Therefore, the question is…
Does it matter where I declare globals?
Thanks
CTB