Another way around this problem is to use a method or variable of a static class.
For example:
class myGlobals { public static $myVariable; }
Then in your functions, you can simply reference your global variable as follows:
function Test() { echo myGlobals::$myVariable; }
Not as clean as some other languages, but at least you don't need to constantly declare it global.
IntelliAdmin Sep 23 '11 at 18:23 2011-09-23 18:23
source share