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

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

WBOY
Release: 2016-06-13 10:26:32
Original
1518 people have browsed it

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

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

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

return 'pre_'.$list;
}

Related labels:
source:php.cn
Statement of this Website
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
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template