';
echo print_r($Cont);
echo '';*/
if (isset($headers['Location']) && !empty($headers['Location'])) {
$url = trim($headers['Location']);
//echo 'Location: '.$url.'
';
continue;
}
//Check feed tag
preg_match("/\?>[\s\S]{0,10}<(rss|rdf|feed)[^>]*>/im", $return, $areg);
if (strpos($return,'/imU',$return,$aRes);
if (!empty($aRes) && !empty($aRes[0])) {
preg_match('/href=(\'|"| )+(.*)(\'|"| )+/imU',$aRes[0],$aRes);
$run++;
if (isset($aRes[2]) && !empty($aRes[2])) {
$url = $aRes[2];
continue;
}
}
break;
}else {
$out=false;
}
}
}else {
$fp = fopen('data','r');
while (!feof($fp)) {
$return .= fread($fp, 4096);
}
fclose($fp);
}
//Remove tag
$format = '';
if(preg_match("/<(rss|rdf|feed)[^>]*>/i", $return, $areg)){
if (isset($areg[1])) {
$format = $areg[1];
}
$pos=strpos($return, '<'.$format);
if($pos!==false){
$return=substr($return, $pos);
}
}
$return=preg_replace("/
]*>/i", '', $return);
list($aChannel, $aFeed) = xmParseFeedArray(basexml2array($return));
$tData = array();
$cnt = 0;
foreach ($aFeed as $key=>$value) {
if ($cnt > $tLimit) {
break;
}
if (!isset($value['description'])) {
$value['description'] = '';
}
if (trim(strip_tags($value['description'])) == '' && trim(strip_tags($value['title'])) == '') {
continue;
}
$tData[$cnt] = $value;
$cnt++;
}
//Check channel
$arr['rss']['channel'] = $aChannel;
$arr['rss']['channel']['item'] = $tData;
$xml = array2xml($arr);
$xml = preg_replace('/[\r\n]/', '', $xml);
$xml = preg_replace('/[\s]{2,}/', ' ', $xml);
//$xml = preg_replace('/[<[\s]*br[\s\/]*>]{0,}/iU', ' ', $xml);
echo '';
echo $xml;
?>