1. $ _ session ['php _ Self ']-Get the file name of the script being executed
2. $ _ server ['server _ Protocol']-Name and version of the communication protocol on the request page. For example, "HTTP/1.0 ".
3. $ _ server ['request _ time']-The timestamp at the request start. Valid from PhP 5.1.0. The same effect as the time function.
4. $ _ server ['argv']-parameters passed to the script. I tried the get method to get $ _ server ['argv'] [0]. The post method cannot assign a value to him.
5. $ _ server ['server _ name']-returns the current host name.
6. $ _ server ['server _ soft']-The string of the server identifier, which is provided in the header information in the Response Request. For example, Microsoft-IIS/6.0
7. $ _ server ['request _ method']-Request Method for accessing the page. For example, "get", "head", "Post", and "put ".
8. $ _ server ['query _ string']-query (query) string (the first question mark in the URL? ).
9. $ _ server ['document _ root']-root directory of the document where the script is currently running. Defined in the server configuration file. E: \ Server
10. $ _ server ['HTTP _ Accept ']-accept of the current request: header information.
11. $ _ server ['HTTP _ accept_charset ']-Accept-charset of the current request: content of the header information. Example: "iso-8859-1, *, UTF-8 ".
12. $ _ server ['HTTP _ accept_encoding ']-Accept-encoding of the current request: content of the header information. For example, "gzip ".
13. $ _ server ['HTTP _ accept_language ']-Accept-language of the current request: content of the header information. For example, "en ".
14. $ _ server ['HTTP _ connection']-connection of the current request: content of the header information. For example, "keep-alive ".
15. $ _ server ['HTTP _ host']-current requested HOST: header information.
16. $ _ server ['HTTP _ referer']-link to the URL of the previous page of the current page.
17. $ _ server ['HTTP _ user_agent ']-return the browser information used by the user. You can also use get_browser () to obtain this information.
18. $ _ server ['https']-If you access through https, it is set to a non-empty value; otherwise, off is returned.
19. $ _ server ['remote _ ADDR ']-browsing the IP address of the user on the current page.
20. $ _ server ['remote _ host']-The host name of the user browsing the current page. Reverse Domain name resolution is based on the user's remote_addr. If the local test returns 127.0.0.1
21. $ _ server ['remote _ port']-The port used by the user to connect to the server. I did not pass the test on the local machine. I don't know why.
22. $ _ server ['script _ filename']-the absolute path name of the currently executed script. E: \ Server \ index. php is returned.
23. $ _ server ['server _ admin']-This value specifies the server_admin parameter in the Apache server configuration file. If the script runs on a VM, the value is the value of that VM.
24. $ _ server ['server _ port']-The port used by the server. The default value is "80 ". If SSL secure connection is used, this value is the http port set by the user.
25. $ _ server ['server _ signature ']-a string containing the server version and virtual host name.
26. $ _ server ['path _ translated ']-the basic path of the file system where the current script is located (not the root directory of the document. This is the result of a virtual image to a real path on the server. Apache 2 users can use acceptpathinfo on in httpd. conf to define path_info.
27. $ _ server ['script _ name']-contains the path of the current script. This is useful when the page needs to point to itself. _ File _ contains the absolute path and file name of the current file (for example, including the file ).
28. $ _ server ['request _ URI ']-The URI required to access this page. For example, "/index.html ".
29. $ _ server ['php _ auth_digest ']-during HTTP digest authentication when running as an Apache module, this variable is set to the "Authorization" HTTP header content sent by the client (For further authentication ).
30. $ _ server ['php _ auth_user ']-When PHP runs in the Apache or IIS (PHP 5 is an ISAPI) module and is using the HTTP authentication function, this variable is the user name entered by the user.
31. $ _ server ['php _ auth_pw ']-When PHP runs in the Apache or IIS (PHP 5 is an ISAPI) module and is using the HTTP authentication function, this variable is the password entered by the user.
32. $ _ server ['auth _ type']-When PHP runs in the Apache module mode and uses the HTTP authentication function, this variable is the authentication type.
You can also use the parse_url function to easily obtain all parts of the URL.
For example:
CodeAs follows:
$ Url = "http://www.electrictoolbox.com/php-extract-domain-from-full-url ";
$ Parts = parse_url ($ URL );
Output:
The Code is as follows:
Array
(
[Scheme] => HTTP
[Host] => www.electrictoolbox.com
[Path] =>/PHP-extract-Domain-from-full-URL/
)
Another example:
The Code is as follows:
<? PHP
$ Url = 'HTTP: // username: password @ Hostname/path? Arg = value # anchor ';
Print_r (parse_url ($ URL ));
Echo parse_url ($ URL, php_url_path );
?>
Output:
The Code is as follows:
Array
(
[Scheme] => HTTP
[Host] => hostname
[User] => Username
[Pass] => Password
[Path] =>/path
[Query] => Arg = Value
[Fragment] => anchor
)
As you can see, it is easy to break down all parts of a URL. It is also easy to take the specified part, as shown in figure
Echo parse_url ($ URL, php_url_path );
In the second parameter, set the following parameters:
Php_url_scheme, php_url_host, php_url_port, php_url_user, php_url_pass, php_url_path, php_url_query or php_url_fragment.