Home >php教程 >php手册 >php中include文件夹分析,

php中include文件夹分析,

WBOY
WBOYOriginal
2016-06-13 08:43:091185browse

php中include文件夹分析,

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

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

 

Statement:
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