PHP Tutorial PHP Advanced PHP References

PHP - Predefined Variables



PHP provides a large number of predefined variables to all scripts which it runs. The variables represent everything from external variables to built-in environment variables, last error messages to last retrieved headers.

List of Predefined Variables

VariableDescription
SuperglobalsBuilt-in variables that are always available in all scopes
$GLOBALSReferences all variables available in global scope
$_SERVERServer and execution environment information
$_GETHTTP GET variables
$_POSTHTTP POST variables
$_FILESHTTP File Upload variables
$_REQUESTHTTP Request variables
$_SESSIONSession variables
$_ENVEnvironment variables
$_COOKIEHTTP Cookies
$php_errormsgThe previous error message
$http_response_headerHTTP response headers
$argcThe number of arguments passed to script
$argvArray of arguments passed to script

5