我正在做客户端自定义,我有多个文件.例如,如果我想在页面home.php上显示页面1.php的代码,我怎么能通过回显它或其他东西来做到这一点.请帮我.谢谢!
您可以通过添加以下文件在脚本中包含文件:PHPhome.php
if ($example){
include("page 1");
}
else {
include("Error.php");
}
Run Code Online (Sandbox Code Playgroud)
或者另一种方法是file_get_contents():
$content = file_get_contents($file_path);
echo $content;
Run Code Online (Sandbox Code Playgroud)