请问:有什么方法在运行时列出当前php文件的所有包含文件?

eduyu 2009-03-21 08:09:52
谢谢
...全文
134 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
nieliwu 2009-03-24
  • 打赏
  • 举报
回复
get_included_files 或者 get_required_files

手册上的例子:

<?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 "$filename\n";
}

?>
海诗美妆 2009-03-24
  • 打赏
  • 举报
回复
get_included_files
renqiang_888 2009-03-21
  • 打赏
  • 举报
回复
get_included_files感觉这个方法好
张吉Jerry 2009-03-21
  • 打赏
  • 举报
回复
get_included_files
fxs_2008 2009-03-21
  • 打赏
  • 举报
回复
在每个被包含的文件里设一个变量

然后在要判断的里则判断这个变量

21,886

社区成员

发帖
与我相关
我的任务
社区描述
从PHP安装配置,PHP入门,PHP基础到PHP应用
社区管理员
  • 基础编程社区
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧