Ok so I'm reading a book called PHP 5 Power Programming.
Quote:
PHP does not support global variables like many other programming
languages (except for some special pre-defined variables, which we discuss
later).
|
He then goes on to say you can access main script variables like so:
$GLOBALS['variable_here'];
I think we all know that. So when someone asks about accessing PHP's global variables, the technical correct answer is NO, PHP does not support it but here's a way to access it within a function....
Is that correct? Kinda confusing....but I get it...
Just want to make sure, because when I take the test, I don't want them asking me, "Does PHP support global variables?"
Then I say, "No".
And the test comes back, "WRONG, you can access it this way: $GLOBALS['variable_here'].."
Which then would mean the test is wrong...