一般是用fputs写入,fgets读取。不过都不好用,比如说:在你要读的页面中有一幅图片的话,那个过程是就慢的,往往都是超时的提示。我建议你用curl函数库来读取

解决方案 »

  1.   

    $sock_fp = fsockopen($host_ip, $port, &$errno, &$errstr, 1);
    fputs($sock_fp,$send_msg);
            while(!feof($sock_fp)) {
                    $send_result = fgets($sock_fp,128);
    if ($send_result==1) 
    }
     fclose($sock_fp);
      

  2.   

    我要读取的就两个数字,sdiliubo提供的代码好象有parse error,另外,返回的数据有两个,我需要把他们分开来,分别echo出来,怎么分开?