(PHP 4, PHP 5, PHP 7, PHP 8)
get_included_files — Betiğe dahil edilen dosyaların isimlerini içeren bir dizi döndürür
include, include_once, require veya require_once kullanarak betiğe dahil edilen tüm dosyaların isimlerini döndürür.
Bu işlevin bağımsız değişkeni yoktur.
Betiğe dahil edilen dosyaların isimlerini içeren bir dizi döndürür.
Betiğin kendisi de içerilmiş bir dosya olarak ele alınır ve ismi dönen diziye dahil edilir.
Betiğe birden fazla dahil edilen dosyaların isimleri dönen dizi içinde bir kere zikredilir.
Örnek 1 - get_included_files() örneği
<?php
// Dosyanın kendi ismi: 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";
}
?>
Yukarıdaki örneğin çıktısı:
/path/to/abc.php /path/to/test1.php /path/to/test2.php /path/to/test3.php /path/to/test4.php