php $_SERVER 中的 QUERY_STRING和REQUEST_URI

來源:互聯網
上載者:User

標籤:div   manage   str   toc   python2   protocol   signature   5.6   component   

index.php

<?phpprint_r($_GET);parse_str($_SERVER[‘QUERY_STRING‘],$get);print_r($get);print_r($_SERVER);?>

輸出:

Array(    [a_a] => 1    [b] => 2)Array(    [a_a] => 1    [b] => 2)Array(    [HTTP_HOST] => www.my.com    [HTTP_CONNECTION] => keep-alive    [HTTP_UPGRADE_INSECURE_REQUESTS] => 1    [HTTP_USER_AGENT] => Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/59.0.3071.115 Safari/537.36    [HTTP_ACCEPT] => text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,*/*;q=0.8    [HTTP_ACCEPT_ENCODING] => gzip, deflate    [HTTP_ACCEPT_LANGUAGE] => zh-CN,zh;q=0.8    [PATH] => C:\ProgramData\Oracle\Java\javapath;C:\Program Files (x86)\Intel\iCLS Client\;C:\Program Files\Intel\iCLS Client\;C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files\Intel\Intel(R) Management Engine Components\DAL;C:\Program Files (x86)\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\Intel(R) Management Engine Components\IPT;C:\Program Files\Intel\WiFi\bin\;C:\Program Files\Common Files\Intel\WirelessCommon\;C:\Program Files\TortoiseSVN\bin;C:\Program Files\Java\jdk1.8.0_131\bin;D:\python2.7;C:\Windows\system32\config\systemprofile\AppData\Local\Microsoft\WindowsApps    [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] => <address>Apache/2.4.23 (Win64) PHP/5.6.25 Server at www.my.com Port 80</address>    [SERVER_SOFTWARE] => Apache/2.4.23 (Win64) PHP/5.6.25    [SERVER_NAME] => www.my.com    [SERVER_ADDR] => 127.0.0.1    [SERVER_PORT] => 80    [REMOTE_ADDR] => 127.0.0.1    [DOCUMENT_ROOT] => D:/wamp64/www/my    [REQUEST_SCHEME] => http    [CONTEXT_PREFIX] =>     [CONTEXT_DOCUMENT_ROOT] => D:/wamp64/www/my    [SERVER_ADMIN] => [email protected]    [SCRIPT_FILENAME] => D:/wamp64/www/my/index.php    [REMOTE_PORT] => 49956    [GATEWAY_INTERFACE] => CGI/1.1    [SERVER_PROTOCOL] => HTTP/1.1    [REQUEST_METHOD] => GET    [QUERY_STRING] => a.a=1&b=2    [REQUEST_URI] => /index.php?a.a=1&b=2    [SCRIPT_NAME] => /index.php    [PHP_SELF] => /index.php    [REQUEST_TIME_FLOAT] => 1500294863.765    [REQUEST_TIME] => 1500294863)

變數名中的點和空格被轉換成底線。例如 <input name="a.b" /> 變成了 $_REQUEST["a_b"]

php $_SERVER 中的 QUERY_STRING和REQUEST_URI

聯繫我們

該頁面正文內容均來源於網絡整理,並不代表阿里雲官方的觀點,該頁面所提到的產品和服務也與阿里云無關,如果該頁面內容對您造成了困擾,歡迎寫郵件給我們,收到郵件我們將在5個工作日內處理。

如果您發現本社區中有涉嫌抄襲的內容,歡迎發送郵件至: info-contact@alibabacloud.com 進行舉報並提供相關證據,工作人員會在 5 個工作天內聯絡您,一經查實,本站將立刻刪除涉嫌侵權內容。

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.