Home > Backend Development > PHP Tutorial > PHP文件引用的一个疑问,请帮忙看一下,多谢

PHP文件引用的一个疑问,请帮忙看一下,多谢

WBOY
Release: 2016-06-13 12:37:15
Original
824 people have browsed it

PHP文件引用的一个疑问,请帮忙看一下,谢谢
一个PHP疑问,请帮忙看一下,
我在index.php中定义一个常量
define('SCRIPT','index');
并引用文件title.php
require 'title.php';
在title.php中,我并没有引用index.php文件,但是也能正常打印出index.php中常量的值
echo SCRIPT; //结果index
请问下,被引用的php文件可以使用引用者php文件中的常量和变量吗?

例:index.php引用了title.php,title.php是不是就可以使用index.php中定义的常量和变量了?

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