php异步请求文件实现多线程的代码
时间:2021-07-01 10:21:17
帮助过:4人阅读
$content=''; - $fp = fsockopen("bbs.it-home.org", 80, $errno, $errstr, 30);
- if (!$fp) {
- echo "$errstr ($errno)
\n"; - } else {
- $out = "POST /test.php?id=5".$content." HTTP/1.1\r\n";
- $out .= "Host:www.php100.com\r\n";
- $out .= "Content-Length: ". strlen($content) ."\r\n";
- $out .= "Connection: Close\r\n\r\n";
- $out .= $content;
- $out .= "\r\n\r\n";
- fwrite($fp, $out);
/*//忽略执行结果 - while (!feof($fp)) {
- echo fgets($fp, strlen($content));
- } */
- echo 'zhinxging';
- fclose($fp);
- }
|