I\'m having trouble with global variables in php. I have a $screen
var set in one file, which requires another file that calls an initSession()
def
global $foo
doesn't mean "make this variable global, so that everyone can use it". global $foo
means "within the scope of this function, use the global variable $foo
".
I am assuming from your example that each time, you are referring to $screen from within a function. If so you will need to use global $screen
in each function.