我试图上传并使用我回过头来的旧脚本,但它给了我一个错误:
PHP警告:get_included_files()需要0个参数,在
中给出1session_start();
ob_start();
get_required_files('config.php');
get_required_files('funksjoner.php');
答案 0 :(得分:2)
get_required_files
(get_included_files()的别名)不接受任何参数。它将返回包含所有包含文件的数组(include
,include_once
,require
和require_once
)。
一个工作示例(来自get_included_files()的参考):
<?php
include 'test1.php';
include_once 'test2.php';
require 'test3.php';
require_once 'test4.php';
// Get all included files
$included_files = get_included_files();
// Loop the files and show the filenames
foreach ($included_files as $filename) {
echo "$filename\n";
}
?>
如果您想要包含文件,只需使用&#34; include&#34;:
<?php
include 'config.php';
include 'funksjoner.php';
?>