: This article mainly introduces the pre-defined variables-PHP manual notes. For more information about PHP tutorials, see. Predefine variables indicate all external variables as built-in environment variables, and indicate error messages as return headers. Hyperglobal variables are built-in variables that are always available in all scopes. No execution is required in a function or method.
global $variableTo access them.
$GOBALSReference all variables available in the global scope, which is always available in PHP.
$_SERVERServer and execution environment information, which contains many array elements, such$_SERVER['PHP_SELFT'],$_SERVER['SCRIPT_FILENAME'],$_SERVER['SERVER_NAME']. The project in this array is created by the Web server, and cannot guarantee that each server provides all the projects.
$_GETThe array of variables passed to the current script through URL parameters.
$_POSTArray of variables passed to the current script through the http post method.
$_FILESArray of files uploaded to the current script through http post.
$_REQUESTBy default$_GET,$_POSTAnd$_COOKIE. When running as a command line, it does not containargvAndargcInformation, they will exist$_SERVERArray. The items in this array and their order depend on PHP'svariables_orderCommand configuration.
$_SESSIONThe current script can use an array of SESSION variables, throughsession_start()Start a new session or reuse an existing session.
$_ENVAn array of variables passed to the current script in the environment mode. these variables are imported from the runtime environment of the PHP parser to the global namespace of PHP.
$_COOKIEThe array of variables passed to the current script through HTTP Cookies.setcookie()Set the Cookie on the client.
$php_errormsgContains the latest error information generated by PHP and is only available in the scope where the error occurs.
$HTTP_RAW_POST_DATAContains the raw data submitted by POST.
$http_response_headerIf the HTTP response header is included, why didn't the experiment succeed in my system.
$argcContains the number of parameters that are passed to the current script when running in the command line. The minimum value is 1. Only inregiser_argc_argvAvailable when enabled.
$argvContains an array of parameters that are passed to the current script under the command line. The first parameter is always the file name of the current script.
(Full text)
The above describes the pre-defined variables-PHP manual notes, including the content, hope to be helpful to friends who are interested in the PHP Tutorial.