如何在PHP中包含外部文件?

Sea*_*ean 3 html php external include

我需要包含另一个URL上的外部文件.例如google.com.我已经使用本地文件测试了include,因此有很多功能,但如果我尝试使用127.0.0.1/filetoinclude.txt则没有任何反应.我没有收到错误,我只是得到一个空白页面.那么我应该如何在我的网页中加入http://google.com

Hor*_*aan 12

我不知道你为什么要这样做,但你肯定会尝试这样的事情:

<?php
    $google_page = file_get_contents('http://www.google.com');
    echo $google_page;
?>
Run Code Online (Sandbox Code Playgroud)