PHP predefined variable instance details

Source: Internet
Author: User
In PHP programming, you often encounter the need to use the address bar information, such as domain names, access URLs, URL parameters, and so on. in this case, you can use the predefined variables provided by PHP, with these predefined variables, you can obtain information such as your session, your operating system environment, and your local operating system environment. The information is stored in the predefined variable $ _ SERVER. What is a PHP predefined variable?

In PHP programming, you often encounter the need to use the address bar information, such as domain names, access URLs, URL parameters, and so on. in this case, you can use the predefined variables provided by PHP, with these predefined variables, you can obtain information such as your session, your operating system environment, and your local operating system environment. The information is stored in the predefined variable.$ _ SERVER. (PHP predefined constant instance details)

Predefine variable $ _ SERVER

$ _ SERVERIt is an array containing information such as header, path, and script locations. below I will print $ _ SERVE, check the content of $ _ SERVER. the code is as follows;

 "; Print_r ($ _ SERVER);?>

The output is as follows:

$ Http_response_header HTTP response header $ number of parameters passed by argc to the script $ argv parameter array passed to the script

The above table shows our PHP pre-defined variables. for details, refer to our PHP self-taught manual and learn PHP constants and variables. in the next section, let's take a look at "what is the difference between PHP constants and variables"

Related course recommendations: pre-defined variables and constants in php1.cn Dugu jiujian (4)-php video tutorial

The above is a detailed description of PHP predefined variable instances. For more information, see other related articles in the first PHP community!

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.