php--Super Global Variables _ Learning notes PHP application global variables PHP global static variable PHP global variable assignment

Source: Internet
Author: User
What is a Hyper global variable

Many of the predefined variables in PHP are "hyper-global", which means they are available in all scopes of a script. There is no need to perform a global $variable in a function or method; You can access them.

$_SERVER//查看服务器信息$_GET//地址栏参数$_POST//表单提交的值$_REQUEST//接受$_GET或$_POST的值$_FILES//文件上传$_COOKIE//跟踪用户状态$_SESSION//跟踪用户状态$GLOBALS//获取所有全局变量的值

$_server:
You can view information about the server, which holds information about the header, path, and location of the script.
Print it out below to see:


    
     print_r($_SERVER);?>

The results are as follows:

Array ([Http_host]=localhost [http_connection]=keep-alive [Http_cache_control]=Max-age=0[Http_accept]=Text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[Http_upgrade_insecure_requests]=1[Http_user_agent]=mozilla/5.0(Windows NT6.1; WOW64) applewebkit/537.36(khtml, like Gecko) chrome/48.0. 2564. theubrowser/5.6. 11466. 7safari/537.36[Http_referer]=http://localhost/php/php7/[Http_accept_encoding]=gzip, deflate [http_accept_language]=zh-cn,zh;q=0.8[PATH]=C: \Windows\System32;C: \ windows;C: \windows\system32\wbem;C: \windows\system32\windowspowershell\v1. 0\; [SystemRoot]=C: \ Windows [COMSPEC]=C: \windows\system32\cmd.exe [Pathext]=. COM;. EXE;. BAT;. CMD;. VBS;. VBE;. JS;. JSE;. WSF;. WSH;. MSC [windir]=C: \ Windows [Server_signature]=apache/2.4. 9(Win64) php/5.5.Server at localhost Port the[Server_software]=apache/2.4. 9(Win64) php/5.5.[SERVER_NAME]=localhost [server_addr]=::1[Server_port]= the[REMOTE_ADDR]=::1[Document_root]=D:/www/[Request_scheme]=HTTP [Context_prefix]=[Context_document_root]=D:/www/[Server_admin]=Admin@example. com [Script_filename]=D:/www/php/php7/demo.php [Remote_port]=52683[Gateway_interface]=cgi/1.1[Server_protocol]=http/1.1[Request_method]=GET [Query_string]=[Request_uri]=/php/php7/demo.php [Script_name]=/php/php7/demo.php [Php_self]=/php/php7/demo.php [Request_time_float]=1460548562.994[Request_time]=1460548562)

'). addclass (' pre-numbering '). Hide (); $ (this). addclass (' has-numbering '). Parent (). append ($numbering); for (i = 1; i <= lines; i++) {$numbering. Append ($ ('
  • '). Text (i)); }; $numbering. FadeIn (1700); }); });

    The above describes the php--super global variable _ learning notes, including the global variables, PHP content, I hope that the PHP tutorial interested in a friend helpful.

  • Related Article

    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.