From the php manual, we can see that Global is the definition of Global variables. its application scope is the current page, including require and include content. For more information about Global applications, see the following php case: & amp; lt ;? Php
From the php manual, we can see that Global is the definition of Global variables. its application scope is the current page, including require and include content. For more information about Global applications, see the following php case:
The above example will report a notice error!
The above usage is correct. after the global variable is declared in the function, all referenced variables of any variable will point to the global variable!
It is also worth mentioning that the global array $ GLOBALS [] is rewritten as follows in the above example:
Note that global declared variables cannot be copied, such as global $ url = "www.phpddt.com". This is an error!