$file="http://www.sina.com/index.php";
$get=file_get_contents($file);
echo $get;

解决方案 »

  1.   

    $file="http://www.sina.com/index.php";
    $open=file($file)$count=count($open);
    for($i=0;$i<$count;$i++)
    {
    $theget.=$open[$i];
    }
    echo $theget;
    这样不行么?错在哪?
    目标文件和源文件怎么个理解法?
      

  2.   

    <?

    $file="http://imdemon.512j.com/index.htm";
    $get=file_get_contents($file);
    echo $get;
    ?>我把这段传到我的PHP空间上测试,结果显示的页面源代码为<HTML></HTML> 
    何解?
      

  3.   

    你这样写法没有错,但用 file_get_contents 会更好点
      

  4.   

    我的目的是把读取到的index.php的HTM文件输出出来,不是输出源代码