Apart from the global keyword, is there any way that a function can access and change global variables?
You can also access global variables anywhere in your scripts with a built-in associative array called $GLOBALS. To access a global variable called $test within a function, you could reference it as $GLOBALS[‘test’]
Leave a Reply
You must be logged in to post a comment.