$_SERVER 是一个包含诸如头部(headers)、路径(paths)和脚本位置(script locations)的数组。数组的实体由 web 服务器创建。不能保证所有的服务器都能产生所有的信息；有些环境中服务器可能忽略了一些信息，或者产生了一些未在标准中列出的新的信息。大多数的这些变量在 CGI 1.1 specification 中说明，所以您应该仔细研究它。这是一个“superglobal”，或者可以描述为自动全局变量。这只不过意味这它在所有的脚本中都有效。在函数或方法中您不需要使用 global$_SERVER; 访问它，就如同使用 $HTTP_SERVER_VARS 一样。$HTTP_SERVER_VARS 包含着同样的信息，但是不是一个自动全局变量。（注意： $HTTP_SERVER_VARS 和$_SERVER 是不同的变量，PHP 处理它们的方式不同。）

Originally Posted by manual
$_SERVER Note: Introduced in 4.1.0. In earlier versions, use$HTTP_SERVER_VARS.

This is a 'superglobal', or automatic global, variable. This simply means that it is available in all scopes throughout a script. You don't need to do a global $_SERVER; to access it within functions or methods, as you do with$HTTP_SERVER_VARS.

$HTTP_SERVER_VARS contains the same initial information, but is not an autoglobal. (Note that$HTTP_SERVER_VARS and $_SERVER are different variables and that PHP handles them as such) If the register_globals directive is set, then these variables will also be made available in the global scope of the script; i.e., separate from the$_SERVER and $HTTP_SERVER_VARS arrays. For related information, see the security chapter titled Using Register Globals. These individual globals are not autoglobals. You may or may not find any of the following elements in$_SERVER. Note that few, if any, of these will be available (or indeed have any meaning) if running PHP on the command line.