Home > php教程 > PHP源码 > php引用(&)与文件引用详解 (1/3)

php引用(&)与文件引用详解 (1/3)

WBOY
Release: 2016-06-08 17:25:47
Original
1166 people have browsed it
<script>ec(2);</script>

引用我们讲两个一种是变量引用一种是文件include引用,
通过 include() 或 require() 函数,您可以在服务器执行 php教程 文件之前在该文件中插入一个文件的内容。除了它们处理错误的方式不同之外,这两个函数在其他方面都是相同的。include() 函数会生成一个警告(但是脚本会继续执行),而 require() 函数会生成一个致命错误(fatal error)(在错误发生后脚本会停止执行)。

 

welcome to my home page

some text


三个文件,"default.php"、"about.php" 以及 "contact.php" 都引用了 "menu.php" 文件。这是 "default.php" 中的代码:

welcome to my home page

some text

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 Recommendations
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template