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!