是否可以列出包含在最后一页中的PHP文件?
假设有一个复杂的PHP脚本,包含许多其他PHP文件的动态内容。是否可以列出PHP脚本在某个执行点之前包含的所有文件?当然,有相应的函数 示例:是否可以列出包含在最后一页中的PHP文件?,php,include,Php,Include,假设有一个复杂的PHP脚本,包含许多其他PHP文件的动态内容。是否可以列出PHP脚本在某个执行点之前包含的所有文件?当然,有相应的函数 示例: <?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
<?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";
}
?>
abc.php
test1.php
test2.php
test3.php
test4.php