superglobal

superglobal? Superglobal is all in scope variable

$GLOBALS

"pre> a contains all global variables combination. The name of a variable is the key of an array.

 < PHP function test (?) {$foo = "local variable"; echo'$foo in global scope: '. $GLOBALS["foo"]. "n"; echo'$foo in current scope:'. $foo. "n"}; $foo = "Example content"; (test); > output? The above routine is similar to the in global scope: Example: $foo content $foo in current scope: local variable 

 < echo "; PHP? < pre> var_dump; ($_SERVER); output: array (size=35)'HTTP_HOST'=> string'localhost' (length=9)'HTTP_CONNECTION''keep-alive' (length=10 => string'HTTP_UPGRADE_INSECURE_REQUESTS'=> string)'1' (length=1)'HTTP_USER_AGENT'=> string'Mozilla/5.0 (Windows; NT 10; WOW64 AppleWebKit/) 537.36 (KHTML like Gecko) Chrome/53.0.2785.104 Safari/537.36 Core/1.53.3538.400 QQBrowser/9.6.12501.400'(length=153)'HTTP_ACCEPT' => string'text/html, application/xhtml+xml, application/xml; q=0.9, image/webp, q=0.8'(length=74) * / *;'HTTP_REFERER' => string'http://localhost/test/'(length=22)'HTTP_ACCEPT_ENCODING' => string'gzip, deflate, sdch'(length=19)'HTTP_ACCEPT_LANGUAGE' => string;'zh-CN, Zh; q=0.8'(length=14)'PATH' => string;'%APPCAN_PATH%; D:Workpython2.7; D:Workpython2.7Scripts; C:ProgramDataOracleJavajavapath; C:WINDOWSsystem32; C:WINDOWS; C:WINDOWSSystem32Wbem; C:WINDOWSSystem32WindowsPowerShellv1.0; D:wampservermysqlbin; D:Work JAVAtomcatbin; D:WorkMozilla Firefoxfirefox.exe; D:Workp Hantomjsbin; D:Workchormedriver; C:WINDOWSsystem32configsystemprofile.dnxbin; C:Program FilesMicrosoft DNXDnvm; C:Program FilesMicrosoft D:wampserverphp; SQL Server130ToolsBinn; C:ProgramDataComposerSetupbi'...'SystemRoot' => (length=607); string'C:WINDOWS'(length=10)'COMSPEC' => string (length=27);'C:WINDOWSsystem32cmd.exe''PATHEXT' => string'.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'(length=53)'WINDIR' => string (length=10);'C:WINDOWS''SERVER_SIGNATURE' => string'SERVER_SOFTWARE'=>' (length=0); string'Apache/2.4.18 (Win64) OpenSSL/1.0.2g PHP/5.6.19'(length=47)'SERVER_NAME' => string (length=9);'localhost''SERVER_ADDR' => string ':: 1' (length=3)'SERVER_POR T'=> string'80' (length=2)'REMOTE_ADDR'=> string':: 1'(length=3)'DOCUMENT_ROOT' => string (length=17);'D:/wampserver/www''REQUEST_SCHEME' => string'http'(length=4)'CONTEXT_PREFIX' => string'CONTEXT_DOCUMENT_ROOT'=>' (length=0); string'D:/wampserver/www'(length=17)'SERVER_ADMIN' => string (length=17);'admin@example.com''SCRIPT_FILENAME' => string'D:/wampserver/www/test/$_SERVER.php'(length=35)'REMOTE_PORT' = > string'57305'(length=5)'GATEWAY_INTERFACE' => string (length=7);'CGI/1.1''SERVER_PROTOCOL' => string'HTTP/1.1'(length=8)'REQUEST_METHOD' => string (length=3);'GET''QUERY_STRING' => string '(length=0)'REQUEST_URI' => (length'/test/$_SERVER.php'; string =18)'SCRIPT_NAME'=> string (length=18);'/test/$_SERVER.php''PHP_SELF'=> string'/test/$_SERVER.php' (length=18)'REQUEST_TIME_FLOAT'=> float'REQUEST_TIME' => int 1510122616

1510122616.201; above this PHP learning predefined variables (examples) is a small share to all people, I hope to give you a reference, but also hope that more family support script.


This concludes the body part