$sock = fsockopen($host, $port, $errno, $errstr, 5); fwrite($sock, $http2); $content=''; while(!feof($sock)) { $content .= fread($sock, 128); } //и тут уже делай с $content-ом твой ereg