doutang1946 2013-12-21 01:47
浏览 44
已采纳

如何用PHP在html中包含github html文件?

Suppose I have a HTML file as --
https://raw.github.com/USER/PROJECT/master/file.html

How do I make it available in my website. One method will be using the rawgithub service and then using something like iframe but I want the HTML to be inherited in my website so that Google shows it in the searches.

php's include function looks like doing the trick but I don't get it to work. I simply use
include "<file_full_URL>";

  • 写回答

3条回答 默认 最新

  • duan0504 2013-12-21 01:49
    关注
    $url = "http://www.example.com"; //write your raw.github.com URL
    $gethtml = file_get_contents($url);
    echo $gethtml; //output the content in the page
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(2条)
编辑
预览

报告相同问题?