- $host="www.ite5e.com";
- $fp = fsockopen("$host", 80, $errno, $errstr, 30);
- if (!$fp) {
- echo "$errstr ($errno)
";
- } else {
- $out = "GET / HTTP/1.1
";
- $out .= "Host: $host
";
- $out .= "Connection: Close
";
- }
-
- fwrite($fp, $out);
- $i=0;
- while($i<2)
- {
- $i ;
- $con.=fread($fp,500);
- }
- //
- echo $con;
- //定义取出的字节数
- preg_match("/Content-Length:.?(d )/", $con, $matches);
- $size = $matches[1];
- echo $size;
- ?>
-
http://www.bkjia.com/PHPjc/486166.htmlwww.bkjia.comtruehttp://www.bkjia.com/PHPjc/486166.htmlTechArticle?php $host="www.ite5e.com"; $fp = fsockopen("$host", 80, $errno, $errstr, 30); if (!$fp) { echo "$errstr ($errno)br /"; } else { $out = "GET / HTTP/1.1"; $out .= "Host: $host"; $ou...