Put simply, these are variables that are available in all scope in your scripts.
This means that there is no need to pass them as parameters in your functions, or store them outside a block of code to have them available in different scopes.
If you’re thinking that these are like superheroes - they’re not.
As of PHP version 7.1.3 there are 9 superglobal variables. They are as follows:
$GLOBALS
- References all variables available in global scope$_SERVER
- Server and execution environment information$_GET
- HTTP GET variables$_POST
- HTTP POST variables$_FILES
- HTTP File Upload variables$_COOKIE
- HTTP Cookies$_SESSION
- Session variables$_REQUEST
- HTTP Request variables$_ENV
- Environment variablesSee the documentation.
I’m sorry for the Grease reference! Link
Time for some explanation on these superheroesglobals.
$GLOBALS