Several predefined variables $ _ SERVER in php: Usage summary and _ server summary. Php predefined variables $ _ SERVER usage summary, _ server summary examples in this article summarize the usage of php predefined variables $ _ SERVER. Share it with you for your reference. The details are as follows: copy several predefined variables $ _ SERVER usage summary and _ server summary
This example summarizes the usage of several predefined variables $ _ SERVER in php. Share it with you for your reference. The details are as follows:
The code is as follows:
<? Php
Echo 'documentroot: '. $ _ SERVER ['document _ root'].'
'; // Root directory, defined in the apache configuration file: httpd. conf for example: DocumentRoot "D:/work/php_root"
Echo 'httphost: '. $ _ SERVER ['http _ host'].'
'; // Domain name, such as localhost
Echo 'phpself: '. $ _ SERVER ['php _ SELF'].'
'; // Path from the root directory to the file itself
Echo 'script filename'. $ _ SERVER ['script _ filename'].'
'; // Documentroot + phpself
Echo 'request uri '. $ _ SERVER ['request _ URI'].'
'; // All URL strings starting from the root directory, including characters after the Question Mark
Echo 'request method: '. $ _ SERVER ['request _ method'].'
'; // Request method
Echo 'name: '. $ _ REQUEST ['name'].'
'; // The value of the request parameter
?>
I hope this article will help you with PHP programming.
How to output php pre-defined variables, such as $ _ SERVER ['server _ ador']
?
Echo--OK ~
If you want to see all the variables under $ _ SERVER
Echo"
";
Var_dump ($ _ SERVER );
Which of the following predefined global array variables are commonly used in PHP?
PHP provides a large number of predefined variables. Because many variables depend on the version and settings of the running server, and other factors, there is no detailed description document. Some predefined variables do not take effect when PHP is run as a command line. Common pre-defined array variables include $ _ POST, $ _ GET, $ _ REQUEST, $ _ COOKIE, $ _ SESSION, and $ _ SERVER. For more information, see The php Manual, the above is clearly written.
Examples in this article summarize the usage of several predefined variables $ _ SERVER in php. Share it with you for your reference. The details are as follows: copy generation...