PHP Superglobals
Most variables in PHP belong to one particular scope, but a handful of built-in ones are different. These are the superglobals, and you can reach them from everywhere in your code.
Inside a function, inside a class, in any file: they are simply there. You don't declare them or pass them in, because PHP makes them available on its own.
Each one is an array. Here is the full set, and what you will find in each:
$GLOBALS- References to every global variable in the script$_SERVER- Details about the web server, such as paths, headers and where scripts are located$_REQUEST- The contents of$_GET,$_POSTand$_COOKIE, brought together$_POST- Values sent to the script with the HTTP POST method$_GET- Values sent to the script with the HTTP GET method$_FILES- Files sent to the script with the HTTP POST method, along with their filename, type and size$_ENV- The environment variables given to the script$_COOKIE- Values the script received through HTTP cookies$_SESSION- The variables stored in the session
A few of these get their own chapters right after this one, and the others come up later in the course.