feed = $feed;
}
function parse()
{
$rss = simplexml_load_file($this->feed);
$rss_split = array();
foreach ($rss->channel->item as $item) {
$title = (string) $item->title;
$link = (string) $item->link;
$description = (string) $item->description;
$rss_split[] = '
'.$title.'
'.$description.'
';
}
return $rss_split;
}
function display($numrows,$head)
{
$rss_split = $this->parse();
$i = 0;
$rss_data = '
';
while ( $i < $numrows )
{
$rss_data .= $rss_split[$i];
$i++;
}
$trim = str_replace('', '',$this->feed);
$user = str_replace('&lang=es-es&format=rss_200','',$trim);
$rss_data.='
';
return $rss_data;
}
}
$feedlist = new rss("http://www.alcaudete.es/index.php/es/actualidad/turismo-patrimonio?format=feed&type=rss");
echo $feedlist->display(4,"Noticias");
?>