本文实例讲述了PHP判断文件是否被引入的方法get_included_files用法。分享给大家供大家参考,具体如下:
<?php// 本文件是 abc.phpinclude 'test1.php';include_once 'test2.php';require 'test3.php';require_once 'test4.php';$included_files = get_included_files();foreach ($included_files as $filename) { echo "$filename/n";}?>
结果:
以上例程会输出:
abc.phptest1.phptest2.phptest3.phptest4.php
查看phpcms的加载文件
D:/xampp/htdocs/duanzu/index.phpD:/xampp/htdocs/duanzu/phpcms/base.phpD:/xampp/htdocs/duanzu/phpcms/libs/functions/global.func.phpD:/xampp/htdocs/duanzu/phpcms/libs/functions/extention.func.phpD:/xampp/htdocs/duanzu/phpcms/libs/functions/autoload/plugin.func.phpD:/xampp/htdocs/duanzu/phpcms/libs/functions/autoload/video.func.phpD:/xampp/htdocs/duanzu/caches/configs/system.phpD:/xampp/htdocs/duanzu/phpcms/libs/classes/application.class.phpD:/xampp/htdocs/duanzu/phpcms/libs/classes/param.class.phpD:/xampp/htdocs/duanzu/caches/configs/route.phpD:/xampp/htdocs/duanzu/phpcms/modules/home/common.phpD:/xampp/htdocs/duanzu/phpcms/model/user_model.class.phpD:/xampp/htdocs/duanzu/phpcms/libs/classes/model.class.phpD:/xampp/htdocs/duanzu/phpcms/libs/classes/db_factory.class.phpD:/xampp/htdocs/duanzu/caches/configs/database.phpD:/xampp/htdocs/duanzu/phpcms/libs/classes/db_mysqli.class.phpD:/xampp/htdocs/duanzu/phpcms/libs/classes/sendsms.class.phpD:/xampp/htdocs/duanzu/phpcms/plugin/Taobao/TopSdk.phpD:/xampp/htdocs/duanzu/phpcms/plugin/Taobao/Autoloader.php
能够窥探项目的加载流程!
更多关于PHP相关内容感兴趣的读者可查看本站专题:《php面向对象程序设计入门教程》、《PHP基本语法入门教程》、《PHP运算与运算符用法总结》、《PHP网络编程技巧总结》、《PHP数组(Array)操作技巧大全》、《php字符串(string)用法总结》、《php+mysql数据库操作入门教程》及《php常见数据库操作技巧汇总》
希望本文所述对大家PHP程序设计有所帮助。
新闻热点
疑难解答