get_included_files

(PHP 4, PHP 5, PHP 7)

get_included_files锟斤拷锟截憋拷 include 锟斤拷 require 锟侥硷拷锟斤拷锟斤拷 array

说锟斤拷

get_included_files ( void ) : array

锟斤拷锟斤拷锟斤拷锟叫憋拷 include锟斤拷 include_once锟斤拷 require 锟斤拷 require_once 锟斤拷锟侥硷拷锟斤拷锟斤拷

锟斤拷锟斤拷值

锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷锟斤拷锟狡碉拷 array锟斤拷

锟脚憋拷锟斤拷锟斤拷锟斤拷锟轿�"锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷"锟斤拷锟斤拷锟皆脚憋拷锟斤拷锟斤拷也锟斤拷锟� include 系锟叫猴拷锟斤拷锟斤拷锟矫的脚憋拷锟斤拷锟斤拷一锟斤拷

锟斤拷锟斤拷锟� include 锟斤拷 require 锟斤拷锟侥硷拷锟节凤拷锟截碉拷 array 锟斤拷只锟斤拷锟叫筹拷一锟轿★拷

锟斤拷锟斤拷

Example #1 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 
"$filename\n";
}

?>

锟斤拷锟斤拷锟斤拷锟教伙拷锟斤拷锟斤拷锟�

/path/to/abc.php
/path/to/test1.php
/path/to/test2.php
/path/to/test3.php
/path/to/test4.php

注锟斤拷

Note:

使锟斤拷 auto_prepend_file 锟斤拷锟斤拷指锟斤拷锟斤拷锟斤拷锟斤拷锟斤拷锟侥硷拷锟斤拷锟斤拷锟斤拷锟斤拷诜锟斤拷氐锟斤拷锟斤拷锟斤拷铩�

锟轿硷拷