Home  >  Article  >  Backend Development  >  PHP tutorial download PHP tutorial predefined variables

PHP tutorial download PHP tutorial predefined variables

WBOY
WBOYOriginal
2016-07-29 08:41:031072browse

These arrays are very special in that they are automatically valid globally, i.e. automatically in any scope. Therefore they are often called autoglobals or superglobals.

Copy the code 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 "The file name of the currently executing script: ".$_SERVER['PHP_SELF'];
//Output : The file name of the currently executing script: /study_php/2-3.php
echo "
";
echo "The root directory where the currently executing script is located: ".$_SERVER['DOCUMENT_ROOT'];
/ /Output: The root directory where the currently executing script is located: H:
echo "
";
echo "The absolute path of the currently executing script: ".$_SERVER['SCRIPT_FILENAME'];
//Output: The absolute path of the currently executing script: H:/study_php/2-3.php
?>

The above introduces the PHP tutorial download PHP tutorial predefined variables, including the content of PHP tutorial download. I hope it will be helpful to friends who are interested in PHP tutorial.

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn