Home >Backend Development >PHP Tutorial >Solution to the failure of the global variable global after multiple PHP includes_PHP Tutorial
The example in this article describes the solution to the failure of the global variable global after multiple includes in PHP. Share it with everyone for your reference. The specific analysis is as follows:
In multiple files, the files are included one after another, but the function in the last file cannot reference global variables after using global. For example:
a.php file:
?
3 |
$aa = 1;
b.php file:
?
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 Previous article:The difference between single and double quotes in php, the difference between double quotes in php_PHP tutorialNext article:The difference between single and double quotes in php, the difference between double quotes in php_PHP tutorial Related articlesSee more |