>  기사  >  백엔드 개발  >  php与http(php预约义变量)

php与http(php预约义变量)

WBOY
WBOY원래의
2016-06-13 11:01:32956검색

php与http(php预定义变量)
var_dump($_SERVER['REQUEST_URI']);
var_dump($this->request->getRequestType());
var_dump($this->request->getIsAjaxRequest());

//打印信息
string(87) "/oms07/index.php?r=preShow/searchFails&idcName=JX&fromTime=2012-02-29&toTime=2012-02-29"
string(3) "GET"
bool(false)


PHP provides a large number of predefined variables to all scripts. The variables represent everything from external variables to built-in environment variables, last error messages to last retrieved headers.

    Superglobals — Superglobals are built-in variables that are always available in all scopes
    $GLOBALS — References all variables available in global scope
    $_SERVER — Server and execution environment information
    $_GET — HTTP GET variables
    $_POST — HTTP POST variables
    $_FILES — HTTP File Upload variables
    $_REQUEST — HTTP Request variables
    $_SESSION — Session variables
    $_ENV — Environment variables
    $_COOKIE — HTTP Cookies
    $php_errormsg — The previous error message
    $HTTP_RAW_POST_DATA — Raw POST data
    $http_response_header — HTTP response headers
    $argc — The number of arguments passed to script
    $argv — Array of arguments passed to script


성명:
본 글의 내용은 네티즌들의 자발적인 기여로 작성되었으며, 저작권은 원저작자에게 있습니다. 본 사이트는 이에 상응하는 법적 책임을 지지 않습니다. 표절이나 침해가 의심되는 콘텐츠를 발견한 경우 admin@php.cn으로 문의하세요.