例子,php异步请求。
<?php
$content='';
$fp = fsockopen("www.jb200.com", 80, $errno, $errstr, 30);
if (!$fp) {
echo "$errstr ($errno)<br />n";
} else {
$out = "POST /test.php?id=5".$content." HTTP/1.1rn";
$out .= "Host:www.php100.comrn";
$out .= "Content-Length: ". strlen($content) ."rn";
$out .= "Connection: Closernrn";
$out .= $content;
$out .= "rnrn";
fwrite($fp, $out);
/*//忽略执行结果
while (!feof($fp)) {
echo fgets($fp, strlen($content));
} */
echo 'zhinxging';
fclose($fp);
}