<?php
$str= array(
'<div class="advert">(.*?)</div>'=>'',
'<div id="left">'=>'',
'<a href="http://cnrdn.com/pmT4" target="_blank">(.*?)</a>'=>'',
'<a href="http://cnrdn.com/ke65" target="_blank">(.*?)</a>'=>'',
'<a href="/pindao/cntv/wafe3.htm'=>'<a href="/tv/cntvs.html',
'<a href="/pindao/gaoerfuwangqiu.htm'=>'<a href="/tv/gefwq.html',
'<a href="/pindao/cctv5.htm'=>'<a href="/tv/cctv5.html',
'<a href="/pindao/pplive/300380.htm'=>'<a href="/tv/tyzb_pptv.html',
'<a href="/pindao/qqlive/xijia2.htm'=>'<a href="/tv/qqxjzb.html',
'<a href="/pindao/pplive/300219.htm'=>'<a href="/tv/ouzhouzuqiu.html',
'<a href="/pindao/pplive/300222.htm'=>'<a href="/tv/jyty.html',
'<a href="/pindao/fengyun.htm'=>'<a href="/tv/fengyuntiyu.html',
'<a href="/pindao/pplive/300224.htm'=>'<a href="/tv/fengyunyingchao.html',
'<a href="/pindao/pplive/300224.htm'=>'<a href="/tv/fengyunyingchao.html',
'<a href="/pindao/sina/pl.htm'=>'<a href="/tv/sinazb.html',
'<a href="/pindao/sohu/epllive4.htm'=>'<a href="/tv/epllive4.html',
'<a href="/pindao/sina/yj.htm'=>'<a href="/tv/sinayj.html',
'<a href="/pindao/qqlive/yijia1.htm'=>'<a href="/tv/qqliveyijia1.html',


'http://kandian.com'=>'http://www.5jty.com/iframe.html?id=http://kandian.com',
'http://match'=>'http://www.5jty.com/iframe.html?id=http://match',
'http://bbs.zhibo8.cc/'=>'http://www.qxzq.com/',

);

$htlm=file_get_contents('http://www.zhibo8.cc');
preg_match('/<div id="body">(.*?)<div id="right">/isU', $htlm, $jg);
foreach ($str as $re => $to )
{
$jg = preg_replace( "@".$re."@is", $to, $jg );
}
$htlma = iconv('UTF-8', 'GBK//IGNORE', trim($jg['1']));
$htlma=rtrim($htlma,'</div>'); 
file_put_contents('zhibo.html',$htlma);
echo trim($htlma);
?>