Pre-defined variables in the PHP Tutorial. These arrays are very special and they take effect globally, for example, automatically within any range. Therefore, arrays that are generally called automatic global variables (autoglobals) or Super global variables take effect automatically within the global range. for example, they take effect automatically within any range. Therefore, it is usually called autoglobals or superglobals ).
The code is as follows:
$ A = "PHP Tutorial Network ";
Echo "get the variable value through \ $ GLOBALS:". $ GLOBALS ['A'];
// Output: Get the variable value through $ GLOBALS: PHP Tutorial network
Echo"
";
Echo "file name of the script being executed:". $ _ SERVER ['php _ SELF '];
// Output: file name of the script being executed:/study_php/2-3.php
Echo"
";
Echo "ROOT directory of the script being executed:". $ _ SERVER ['document _ root'];
// Output: the root directory of the script being executed: H:
Echo"
";
Echo "absolute path of the SCRIPT being executed:". $ _ SERVER ['script _ filename'];
// Output: the absolute path of the script being executed: H:/study_php/2-3.php
?>
Bytes. Therefore, it is usually called an automatic global variable (autoglobals) or a super global variable...