Home >Backend Development >PHP Tutorial >。新手有关问题,关于require后的变量引用。

。新手有关问题,关于require后的变量引用。

WBOY
WBOYOriginal
2016-06-13 10:26:321498browse

。。。新手问题,关于require后的变量引用。。。。
有3个php文件,
a.php
require b.php;
require c.php;
?>

我的问题是,在c中能引用b.php里的变量吗?

------解决方案--------------------
修改一下:
$list;
function getList() {
global $list;
$list = 'ok';

return 'pre_'.$list;
}

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