php global usage

WBOY
WBOYOriginal
2016-07-29 08:50:211460browse

<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></code>
').addClass('pre-numbering').hide(); $(this).addClass('has-numbering').parent().append($numbering); for (i = 1; i ').text(i)); }; $numbering.fadeIn(1700); }); });

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.

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