Warning: file_get_contents(/data/phpspider/zhask/data//catemap/4/maven/6.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
是否可以列出包含在最后一页中的PHP文件?_Php_Include - Fatal编程技术网

是否可以列出包含在最后一页中的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脚本,包含许多其他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 ($included_files as $filename) {
    echo "$filename\n";
}

?>
abc.php
test1.php
test2.php
test3.php
test4.php