我需要回显包含文件的全部内容.我试过以下:
echo "<?php include ('http://www.example.com/script.php'); ?>";
echo "include (\"http://www.example.com/script.php\");";
Run Code Online (Sandbox Code Playgroud)
但都不起作用?PHP支持这个吗?
cee*_*yoz 18
做就是了:
include("http://www.mysite.com/script.php");
Run Code Online (Sandbox Code Playgroud)
要么:
echo file_get_contents("http://www.mysite.com/script.php");
Run Code Online (Sandbox Code Playgroud)
笔记:
allow_url_fopen
为您的PHP安装启用.有些主机将其关闭.