PHP Tutorial predefine variable _ PHP Tutorial-php Tutorial

Source: Internet
Author: User
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...

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.