fopen以后
print_r(stream_get_meta_data($htmlfp));
看看

解决方案 »

  1.   

    蛮有意思的。
     $filepath = "http://www.baidu.cn"; 
        $filepath = trim ($filepath); 
        $htmlfp = fopen( "'$filepath'" , 'r'); //试试这样,我这里没有环境,没法调。 
        if (strstr ($filepath, '://')) 
        { 
          while ($data = @fread ($htmlfp, 500000)) 
          { 
            $string .= $data; 
          } 
        } 
    echo $string; 
      

  2.   


    <?php
    $string = '';
    $filepath = 'http://www.baidu.cn'; 
    $filepath = ( ereg( 'http://', trim($filepath ) ) ? $filepath : 'http://'.$filepath ); //最好正则一下前7位是否是http://$htmlfp = fopen( $filepath, 'r' ); while ( !feof( $htmlfp ) ):
    echo fgets( $htmlfp, 128 ); //一边get一边输出,这样速度快。
    endwhile;fclose($htmlfp); //最后别忘记关闭文件。
    ?>PHP5.25测试OK!
      

  3.   

    把最上面的$string = '';去掉,我忘记删了/