Include whole content of a file and echo it

后端 未结 6 1086
迷失自我
迷失自我 2020-12-10 02:54

I need to echo entire content of included file. I have tried the below:

echo \"\";

echo \"inc         


        
6条回答
  •  心在旅途
    2020-12-10 03:07

    Just do:

    include("http://www.mysite.com/script.php");
    

    Or:

    echo file_get_contents("http://www.mysite.com/script.php");
    

    Notes:

    • This may slow down your page due to network latency or if the other server is slow.
    • This requires allow_url_fopen to be on for your PHP installation. Some hosts turn it off.
    • This will not give you the PHP code, it'll give you the HTML/text output.

提交回复
热议问题