欢迎各位兄弟 发布技术文章
这里的技术是共享的
// Call the url and return immediately with the length of the data read. // Useful for firing off scripts by calling a url. $fp = fopen($url, 'r'); stream_set_blocking($fp, 0); // 0 => non-blocking mode $data = fread($fp, 8192); // 1024 * 8 = 8192 fclose($fp); // Return the amount of data read return strlen($data); } 来自 https://www.darklaunch.com/2013/03/23/php-non-blocking-fopen-file-get-contents-using-stream-set-blocking