Home > php教程 > php手册 > php中include文件夹分析 - 云翳1895

php中include文件夹分析 - 云翳1895

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
Release: 2016-05-20 11:54:38
Original
2019 people have browsed it

include是包含很多php文件的一种汇总;一般放在文件夹最外层。

<span style="color: #000000;">php 
</span><span style="color: #008080;">header</span>("content-type:text/html;charset=utf-8");<span style="color: #008000;">//</span><span style="color: #008000;">设置字符</span>
date_default_timezone_set("PRC");<span style="color: #008000;">//</span><span style="color: #008000;">设置时间区域为中国</span>
<span style="color: #008080;">session_start</span>();<span style="color: #008000;">//</span><span style="color: #008000;">全局开启session</span>
<span style="color: #008080;">define</span>("ROOT",<span style="color: #008080;">dirname</span>(<span style="color: #ff00ff;">__FILE__</span>));<span style="color: #008000;">//</span><span style="color: #008000;">__FILE__是当前文件的绝对完整路径;dirname()获取返回当前文件路径的 绝对路径部分</span>
<span style="color: #008080;">set_include_path</span>(".".PATH_SEPARATOR.ROOT."/lib".PATH_SEPARATOR.ROOT."/core".PATH_SEPARATOR.ROOT."/configs".PATH_SEPARATOR.<span style="color: #008080;">get_include_path</span><span style="color: #000000;">());
</span><span style="color: #008000;">//</span><span style="color: #008000;">set_include_path()是设置包含文件的路径</span>
<span style="color: #0000ff;">require_once</span> 'mysql.func.php'<span style="color: #000000;">;
</span><span style="color: #0000ff;">require_once</span> 'image.func.php';
Copy after login

 

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