aa.php global$a; require('./b.php'); echo"a ---:$a\n"; b.php $a = 123; php aa.php 输出结果:a ---:123 去掉aa.php 里面的glocal $a php aa.php 输出结果是 a --:
The above introduces the usage of php global, including global and php content. I hope it will be helpful to friends who are interested in PHP tutorials.