function uc_fopen($url, $limit = 0, $post = '', $cookie = '', $bysocket = FALSE, $ip = '', $timeout = 15, $block = TRUE) {<br> $return = '';<br> $matches = parse_url($url);<br> !isset($matches['host']) && $matches['host'] = '';<br> !isset($matches['path']) && $matches['path'] = '';<br> !isset($matches['query']) && $matches['query'] = '';<br> !isset($matches['port']) && $matches['port'] = '';<br> $host = $matches['host'];<br> $path = $matches['path'] ? $matches['path'].($matches['query'] ? '?'.$matches['query'] : '') : '/';<br> $port = !empty($matches['port']) ? $matches['ポート'] : 80;<br> if($post) {<br> $out = "POST $path HTTP/1.0rn";<br> $out .= "受け入れる: */*rn";<br> //$out .= "リファラー: $boardurlrn";<br> $out .= "Accept-Language: zh-cnrn";<br> $out .= "Content-Type: application/x-www-form-urlencodedrn";<br> $out .= "ユーザーエージェント: $_SERVER[HTTP_USER_AGENT]rn";<br> $out .= "ホスト: $hostrn";<br> $out .= 'Content-Length: '.strlen($post)."rn";<br> $out .= "接続: 閉じる";<br> $out .= "キャッシュ制御: キャッシュなし";<br> $out .= "Cookie: $cookiernrn";<br> $out .= $post;<br> } else {<br> $out = "GET $path HTTP/1.0rn";<br> $out .= "受け入れる: */*rn";<br> //$out .= "リファラー: $boardurlrn";<br> $out .= "Accept-Language: zh-cnrn";<br> $out .= "ユーザーエージェント: $_SERVER[HTTP_USER_AGENT]rn";<br> $out .= "ホスト: $hostrn";<br> $out .= "接続: 閉じる";<br> $out .= "Cookie: $cookiernrn";<br> }<br> if(function_exists('fsockopen')) {<br> $fp = @fsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);<br> } elseif (function_exists('pfsockopen')) {<br> $fp = @pfsockopen(($ip ? $ip : $host), $port, $errno, $errstr, $timeout);<br> } else {<br> $fp = false;<br> }<br> <br> if(!$fp) {<br> 戻る '';<br> } else {<br> stream_set_blocking($fp, $block);// 让程序障害なし<br> stream_set_timeout($fp, $timeout);<br> @fwrite($fp, $out);<br> $status = stream_get_meta_data($fp);// 读取流時の時間制御に作用します<br> if(!$status['timed_out']) {<br> while (!feof($fp)) {<br> if(($header = @fgets($fp)) && ($header == "rn" || $header == "n")) { <div class="clear"></div>