用PHP阅读源代码 [英] Read source code with PHP

查看:97
本文介绍了用PHP阅读源代码的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有阅读另一个网站的源代码?
源代码为HTML,当你点击一个网站,然后源代码。



我试过了:

 <? $ f = fopen(http://www.example.com/f,r); 
echo $ f;
?>

没有用。如何做到这一点?

解决方案

试试

 <?php 
$ f = file_get_contents(http://www.site.com/f);
echo $ f;
?>


Is there away to read a source code from another site? Source code as HTML, when you right click on a site and then "Source code".

I've tried:

<? $f = fopen ("http://www.example.com/f", r);
echo $f;
?>

It did not work. How do I do this?

解决方案

Try

<?php
$f = file_get_contents("http://www.site.com/f");
echo $f;
?>

这篇关于用PHP阅读源代码的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆