怎么把这个页面读成一个字符串http://www.verycd.com/topics/2892646/

解决方案 »

  1.   

    <?php
    echo file_get_contents('http://www.baidu.com');
      

  2.   

    用fopen 会出错.$str=fopen("http://www.phpchina.com/index.php","r");
    出错如下
    Warning: fopen() [function.fopen]: php_network_getaddresses: getaddrinfo failed: ??֪??⑹?Ė?? in E:\AppServ\www\b\index.php on line 67Warning: fopen(http://www.phpchina.com/index.php) [function.fopen]: failed to open stream: No error in E:\AppServ\www\b\index.php on line 67file_get_contents 这个也不行。出的错和上面差不多。
      

  3.   

    $str=fopen("http://192.168.2.200/index.php","r"); 就不出错
    因为192.168.2.200/后面的index.php是真实的,所以就不出错了。
      

  4.   

    报错呀Warning:file_get_contents [function.fopen]: php_network_getaddresses: getaddrinfo failed: ??֪??⑹?Ė?? in