span style="color: #0000BB"><?phpfunction curl_get_file_contents($URL, $post = false) { $header[] = 'Accept: text/xml,application/xml,application/xhtml+xml,text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5'; $header[] = 'Connection: Close'; $header[] = 'Accept-Charset: iso-8859-1, utf-8, utf-16, *;q=0.1'; $header[] = 'Accept-Language: ru-RU,ru;q=0.9,en;q=0.8'; $header[] = 'User-Agent: Opera 8/0'; $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $URL); curl_setopt($curl, CURLOPT_HTTPHEADER, $header); curl_setopt($curl, CURLOPT_AUTOREFERER, false); curl_setopt($curl, CURLOPT_RETURNTRANSFER, true); curl_setopt($curl, CURLOPT_FOLLOWLOCATION, true); curl_setopt($curl, CURLOPT_HEADER, false); $contents = curl_exec($curl); curl_close($curl); return $contents; } $file = curl_get_file_contents('http://site.ru'.$_SERVER['QUERY_STRING']); $file = preg_replace('/<\?xml(.*?)<\/a><\/div>/si', '', $file); //$file = str_replace('href="/', 'href="', $file); $file = preg_replace('/<div class="sec"(.*?)<\/html>/si', '', $file); echo $file; |