php引述文件的方法

WBOY
Release: 2016-06-13 13:02:10
Original
961 people have browsed it

php引用文件的方法

转自: ?http://www.phpweblog.net/yemoo/archive/2007/09/29/2046.html?

?

引用文件的方法有两种:require 及 include。两种方式提供不同的使用弹性。

require?的使用方法如?require("MyRequireFile.php");?。这个函数通常放在 PHP 程序的最前面,PHP 程序在执行前,就会先读入 require 所指定引入的文件,使它变成 PHP 程序网页的一部份。常用的函数,亦可以这个方法将它引入网页中。

include?使用方法如?include("MyIncludeFile.php");?。这个函数一般是放在流程控制的处理部分中。PHP 程序网页在读到 include 的文件时,才将它读进来。这种方式,可以把程序执行时的流程简单化。

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
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!