Maison >développement back-end >tutoriel php > fsockopen 异步不已,求大侠
fsockopen 异步不了,急求大侠
<?php<br /> $fp = fsockopen("127.0.0.1", 80, $errno, $errstr, 30);<br /> if (!$fp) {<br /> echo "$errstr ($errno)<br />\n";<br /> } else {<br /> $out = "GET /public/b.php HTTP/1.1\r\n";<br /> $out .= "Host: 127.0.0.1\r\n";<br /> $out .= "Connection: Close\r\n\r\n";<br /> fwrite($fp, $out);<br /> while (!feof($fp)) {<br /> echo fgets($fp, 128);<br /> }<br /> fclose($fp);<br /> }<br /> ?>