<?php
$fp = fsockopen("www.baidu.com", 80, &$errno, &$errstr, 10);
if(!$fp) {
echo "$errstr ($errno)<br>
";
} else {
fputs($fp,"GET / HTTP/1.0
Host: www.baidu.com
");
while(!feof($fp)) {
echo fgets($fp,128);
}
fclose($fp);
}
?>