Тема: Парсер (WAP/WEB мастеру/Помощь мастерам) Sentiment (23 Dec 2014 в 14:07) Файл - index.php <?php error_reporting(0); include_once \'./head.php\'; $ctime = 86400; ob_start(); $id = $_GET[\'id\']; $url = (\'http://mast-wap.ru/obmen/\'.$id); $curl = curl_init(); curl_setopt($curl, CURLOPT_URL, $url); curl_setopt($curl,CURLOPT_USERAGENT,\'Opera/9.80 (Windows NT 5.1; U; ru) Presto/2.2.15 Version/10.10\'); curl_setopt($curl, CURLOPT_REFERER, \"http://mast-wap.ru\"); curl_setopt($curl, CURLOPT_RETURNTRANSFER,1); curl_setopt($curl, CURLOPT_TIMEOUT, 30); $file = curl_exec($curl); curl_close($curl); include \'./sys.php\'; echo $file; $buffer = ob_get_contents(); ob_end_clean(); file_put_contents($cfile, $buffer); echo $buffer; include \'foot.php\'; ?> Sentiment (23 Dec 2014 в 14:08) Файл sys.php <?php $file = str_replace(\'<?xml version=\"1.0\" encoding=\"utf-8\"?>\',\'\',$file); $file = preg_replace(\'|<!DOCTYPE(.*?)<div class=\"label\">|is\',\'<div class=\"label\">\',$file); $file = preg_replace(\'|<div class=\"label\" style=\"text-align:center\">(.*?)</html>|is\',\'\',$file); $file = str_replace(\'href=\"/obmen/get/\',\'href=\"http://mast-wap.ru/obmen/get/\',$file); $file = str_replace(\'href=\"/obmen/\',\'href=\"?id=\',$file); ?> Источник: http://www.dcms-social.ru/forum/20/44/56412/