Pre-defined variables-PHP manual notes

Source: Internet
Author: User
Tags http post

Original: pre-defined variables-PHP manual notes

The predefined variables represent all external variables as built-in environment variables, and the error information is represented as a return header. A hyper-global variable is a built-in variable that is always available in all scopes. You can access them without having to do it in a function or method global $variable .

$GOBALSAll variables available in the global scope are referenced and are always available in PHP.

$_SERVERServer and execution environment information, this contains more array elements, such as, and $_SERVER[‘PHP_SELFT‘] $_SERVER[‘SCRIPT_FILENAME‘] $_SERVER[‘SERVER_NAME‘] so on. The items in this array are created by the Web server, and there is no guarantee that each server will provide all the items.

$_GETAn array of variables passed to the current script through the URL parameter.

$_POSTAn array of variables passed to the current script through the HTTP POST method.

$_FILESAn array of files uploaded to the current script via the HTTP POST method.

$_REQUESTThe default contains $_GET $_POST $_COOKIE arrays of, and. When run as a command line, it will not contain argv and argc information that they will exist with the $_SERVER array. This array of items and their order depends on the configuration of the instructions with PHP variables_order .

$_SESSIONThe current script can use an array of session variables, either by starting a new session session_start() or by reusing existing sessions.

$_ENVAn array of variables that are passed to the current script through the environment, which are imported into the global namespace of PHP from the runtime environment of the PHP parser.

$_COOKIEAn array of variables passed to the current script via HTTP cookies can be setcookie() set by a cookie on the client.

$php_errormsgContains the most recent error information generated by PHP and is available only in the scope where the error occurred.

$HTTP_RAW_POST_DATAContains the original data for the post submission.

$http_response_headerContains the HTTP response header, how did the experiment succeed in my system?

$argcContains the number of parameters that are passed to the current script at the command line, with a minimum value of 1. Available only regiser_argc_argv when open.

$argvContains an array of parameters that are passed to the current script at the command line, and the first parameter is always the file name of the current script.

(End of full text)

Pre-defined variables-PHP manual notes

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.