«

PHP判断文件是否被引入的方法get_included_files用法示例

时间:2024-2-29 20:57     作者:韩俊     分类: PHP


本文实例讲述了PHP判断文件是否被引入的方法get_included_files用法。分享给大家供大家参考,具体如下:

<?php
// 本文件是 abc.php
include 'test1.php';
include_once 'test2.php';
require 'test3.php';
require_once 'test4.php';
$included_files = get_included_files();
foreach ($included_files as $filename) {
  echo "$filenamen";
}
?>

结果:

以上例程会输出:

abc.php
test1.php
test2.php
test3.php
test4.php

查看phpcms的加载文件

D:xampphtdocsduanzuindex.php
D:xampphtdocsduanzuphpcmsbase.php
D:xampphtdocsduanzuphpcmslibsfunctionsglobal.func.php
D:xampphtdocsduanzuphpcmslibsfunctionsextention.func.php
D:xampphtdocsduanzuphpcmslibsfunctionsautoloadplugin.func.php
D:xampphtdocsduanzuphpcmslibsfunctionsautoloadvideo.func.php
D:xampphtdocsduanzucachesconfigssystem.php
D:xampphtdocsduanzuphpcmslibsclassesapplication.class.php
D:xampphtdocsduanzuphpcmslibsclassesparam.class.php
D:xampphtdocsduanzucachesconfigsroute.php
D:xampphtdocsduanzuphpcmsmoduleshomecommon.php
D:xampphtdocsduanzuphpcmsmodeluser_model.class.php
D:xampphtdocsduanzuphpcmslibsclassesmodel.class.php
D:xampphtdocsduanzuphpcmslibsclassesdb_factory.class.php
D:xampphtdocsduanzucachesconfigsdatabase.php
D:xampphtdocsduanzuphpcmslibsclassesdb_mysqli.class.php
D:xampphtdocsduanzuphpcmslibsclassessendsms.class.php
D:xampphtdocsduanzuphpcmspluginTaobaoTopSdk.php
D:xampphtdocsduanzuphpcmspluginTaobaoAutoloader.php

能够窥探项目的加载流程!

希望本文所述对大家PHP程序设计有所帮助。

标签: php php教程

热门推荐