PHP Several predefined variables $_server usage Summary, _server summary _php Tutorial

Source: Internet
Author: User

PHP Several predefined variables $_server usage Summary, _server Summary


This paper summarizes the usage of several predefined variables $_server in PHP. Share to everyone for your reference. Specific as follows:

Copy the Code code as follows: <?php
Echo ' DocumentRoot: '. $_server[' Document_root ']. '
'; The root directory, defined in the Apache configuration file: httpd.conf For example: DocumentRoot "D:/work/php_root"
Echo ' Httphost: '. $_server[' Http_host ']. '
'; Domain names, such as: localhost
Echo ' phpself: '. $_server[' php_self ']. '
'; The path from the root directory to the file itself
echo ' script filename '. $_server[' Script_filename ']. '
'; Documentroot+phpself
echo ' request URI '. $_server[' Request_uri '. '
'; Start all URL strings from the root directory, including the characters after the question mark
Echo ' request method: '. $_server[' Request_method '. '
'; Method of Request
Echo ' name: '. $_request[' name ']. '
'; The value of the request parameter
?>

I hope this article is helpful to everyone's PHP programming.


PHP predefined variables how to output such as this $_server[' Server_ador ']


echo--Just fine ~
If you want to see all the variables under the $_server
echo "

 Var_dump ($_server); 
 
What are some of the predefined global array variables commonly used in PHP?

php provides a number of predefined variables. Because many variables depend on the version and settings of the server that is running, and other factors, no detailed documentation is provided. Some of the predefined variables do not take effect when PHP is run as a command line. The commonly used predefined array variables are $_post,$_get,$_request,$_cookie,$_session,$_server and so on, specifically you can refer to the PHP manual, which is clearly written.
 

http://www.bkjia.com/phpjc/907843.html Span id= "Indexurl" itemprop= "Indexurl" >www.bkjia.com true http://www.bkjia.com/phpjc/907843.html techarticle php several pre-defined variables $_server usage summary, _server Summary The usage of several predefined variables $_server in PHP is summarized in this paper. Share to everyone for your reference. The following: Replication generation ...

  • 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.