您好,欢迎访问一九零五行业门户网

PHP——超全局变量_学习笔记 php application 全局变量 php 全局静态变量 php全局变量赋

什么是超全局变量
php 中的许多预定义变量都是“超全局的”,这意味着它们在一个脚本的全部作用域中都可用。在函数或方法中无需执行 global $variable; 就可以访问它们。
$_server//查看服务器信息$_get//地址栏参数$_post//表单提交的值$_request//接受$_get或$_post的值$_files//文件上传$_cookie//跟踪用户状态$_session//跟踪用户状态$globals//获取所有全局变量的值
$_server:
可以查看服务器的信息,里面保存关于报头、路径和脚本位置的信息。
下面打印出来看下:

结果如下:
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 nt 6.1; wow64) applewebkit/537.36 (khtml, like gecko) chrome/48.0.2564.116 ubrowser/5.6.11466.7 safari/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.12 server at localhost port 80 [server_software] => apache/2.4.9 (win64) php/5.5.12 [server_name] => localhost [server_addr] => ::1 [server_port] =>80 [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 ').text(i)); }; $numbering.fadein(1700); }); }); 以上就介绍了php——超全局变量_学习笔记,包括了全局变量,php方面的内容,希望对php教程有兴趣的朋友有所帮助。
其它类似信息

推荐信息