4
A
回答
14
get_included_files
或get_required_files
(的get_included_files
别名)
http://us.php.net/manual/en/function.get-included-files.php
http://us.php.net/manual/en/function.get-required-files.php(的get_included_files
别名)
<?php
// This file is 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 "$filename\n";
}
?>
-----
The above example will output:
abc.php
test1.php
test2.php
test3.php
test4.php
1
1
register_shutdown_function(
function() {
your_logger(get_included_files());
}
);
get_included_files将被称为在脚本执行结束,所以你会得到包含文件的完整列表
+0
虽然这可能是答案,但建议在答案中包含文档和/或解释。 – Pietu1998 2015-01-26 10:31:59
相关问题
- 1. 包含列表
- 2. 包含列表
- 3. php包含外部网址
- 4. 包含外部类php
- 5. 识别子列表完全包含其他列表
- 6. 包含文本的部分与包含无序列表的部分重叠
- 7. 包含对列表
- 8. jquery包含列表
- 9. AppleScript列表/包含
- 10. rails包含查询加载包含模型的全部数据
- 11. Mysql - 选择必须包含全部
- 12. 斯威夫特字典全部包含
- 13. eclipse没有解决全部包含
- 14. php变量包含全局错误
- 15. PHP - “包含”功能是否安全?
- 16. 列表<Customer>全部或全部
- 17. 检查日期列包含在每年的全部时间
- 18. 包含“外部”列和SP本机列的SharePoint列表
- 19. 只有2列包含全零
- 20. 到包含一个python列表,列表
- 21. Linq查询列表包含列表
- 22. Codename一个包含列表的列表
- 23. R:包含列表的列表
- 24. 包含列表视图
- 25. 字典包含列表
- 26. UnmarshalJSON包含接口列表
- 27. AzCopy - 包含表和队列
- 28. Elisp列表包含值
- 29. C#列表包含项目
- 30. 遍历包含列表
非常好,不知何故,我无法在文档中找到它。 – Liam 2009-08-21 08:46:56
您可以使用'var_dump(get_included_files())'而不是使用foreach循环。该函数返回一个数组。 – 2017-03-06 17:47:20