W3Cschool
恭喜您成為首批注冊用戶
獲得88經(jīng)驗值獎勵
(PHP 4, PHP 5, PHP 7, PHP 8)
get_included_files — 返回被 include 和 require 文件名的 array
get_included_files(): array
返回所有被 include、 include_once、 require 和 require_once 的文件名。
此函數(shù)沒有參數(shù)。
返回所有文件名稱的 array。
腳本最初被稱為”被包含的文件“,所以腳本自身也會和 include 系列函數(shù)引用的腳本列在一起。
被多次 include 和 require 的文件在返回的 array 里只會列出一次。
示例 #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
Copyright©2021 w3cschool編程獅|閩ICP備15016281號-3|閩公網(wǎng)安備35020302033924號
違法和不良信息舉報電話:173-0602-2364|舉報郵箱:jubao@eeedong.com
掃描二維碼
下載編程獅App
編程獅公眾號
聯(lián)系方式:
更多建議: