<code>aa.php <span><span><?php </span><span>global</span><span>$a</span>; <span>require</span>(<span>'./b.php'</span>); <span>echo</span><span>"a ---:$a\n"</span>; b.php <span><?php </span><span>$a</span> = <span>123</span>; php aa.php 输出结果:a ---:<span>123</span> 去掉aa.php 里面的glocal <span>$a</span> php aa.php 输出结果是 a --: </span></span></span></code>
以上就介绍了php global用法,包括了global,php方面的内容,希望对PHP教程有兴趣的朋友有所帮助。