就是这个东东
<?
error_reporting(E_ALL);
set_time_limit(0);
$runtimes = 1000;for ($i=0; $i<$runtimes; $i++)
{
$datetime = date('Y-m-d G:i:s');
$str = f_fsock("www.baidu.com","/s?wd=1000" . $i);
echo $i . " " . $datetime . " <textarea>" . $str . "</textarea><br/>";
}function f_fsock($website,$url)
{
$fp = fsockopen($website, 80, $errno, $errstr, 30);
if ($fp)
{
$out = "GET " . $url . " HTTP/1.1\r\n";
$out .= "Host: " . $website . "\r\n";
$out .= "Connection: Close\r\n\r\n";
fwrite($fp, $out);
$str = "";
while (!feof($fp))
{
stream_set_timeout($fp, 20);
$str .= fread($fp, 8192);
$info = stream_get_meta_data($fp);
if ($info['timed_out'])
{
$str = "";
echo("SOCKET: " . "Connection timed out! " . "($errno) $errstr" . "<br/>");
break;
}
}
fclose($fp);
return $str;
}
else
{
echo("SOCKET: " . "fsockopen error! " . "($errno) $errstr" . "<br/>");
}
}
?>