
- PHP 7 Tutorial
- PHP 7 - Home
- PHP 7 - Introduction
- PHP 7 - Performance
- PHP 7 - Environment Setup
- PHP 7 - Scalar Type Declarations
- PHP 7 - Return Type Declarations
- PHP 7 - Null Coalescing Operator
- PHP 7 - Spaceship Operator
- PHP 7 - Constant Arrays
- PHP 7 - Anonymous Classes
- PHP 7 - Closure::call()
- PHP 7 - Filtered unserialize()
- PHP 7 - IntlChar
- PHP 7 - CSPRNG
- PHP 7 - Expectations
- PHP 7 - use Statement
- PHP 7 - Error Handling
- PHP 7 - Integer Division
- PHP 7 - Session Options
- PHP 7 - Deprecated Features
- PHP 7 - Removed Extensions & SAPIs
- PHP 7 Useful Resources
- PHP 7 - Quick Guide
- PHP 7 - Useful Resources
- PHP 7 - Discussion
PHP superglobals
Introduction
In addition to user defined variables, PHP populates the global namespace with a number of predefined variables called superglobals. They are always available to be accessed from within any function or method, without specifying the global keyword. List of supperglobals is given below −
$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 |
$_?REQUEST | HTTP Request variables |
$_?SESSION | Session variables |
$_?ENV | Environment variables |
$_?COOKIE | HTTP Cookies |
$php_?errormsg | The previous error message |
$HTTP_?RAW_?POST_?DATA | Raw POST data |
$http_?response_?header | HTTP response headers |
$argc | The number of arguments passed to script |
$argv | Array of arguments passed to script |
- Related Articles
- PHP php://
- Upload file with php to another php server
- PHP Generators.
- PHP Overloading
- PHP Traits
- PHP $_GET
- PHP $GLOBALS
- PHP $_SERVER
- PHP References
- PHP Constants
- PHP Expressions
- PHP Tags
- PHP Iterables
- PHP NULL
- PHP Objects.

Advertisements