Ver Mensaje Individual
  #2 (permalink)  
Antiguo 30/03/2008, 20:21
Avatar de destor77
destor77
 
Fecha de Ingreso: noviembre-2004
Ubicación: Gálvez, Santa Fe, Argentina
Mensajes: 2.654
Antigüedad: 19 años, 6 meses
Puntos: 43
Re: rss y simplexml

bueno sin quererlo encontre la solución se la dejo para el que quiera usarla:

Código PHP:
$Noticias simplexml_load_file('http://www.softonic.com/rss/2/feed_last_news_by_date_actualized.xml');
    if (!
count((array)$Noticias->item))
    
//Si es 0 quiere decir que existe la etiqueta channel
    
{
        echo 
"Publicado el: ".$Noticias->channel->pubDate."<br>";
        foreach(
$Noticias->channel->item as $Noticia)
        {
            echo 
"titulo: ".utf8_decode($Noticia->title)."<br>";
            echo 
"description: ".utf8_decode($Noticia->description)."<br>";
        }
    }
    else
    {
        foreach(
$Noticias->item as $Noticia)
        {
            echo 
"titulo: ".utf8_decode($Noticia->title)."<br>";
            echo 
"description: ".utf8_decode($Noticia->description)."<br>";

        }
    } 
saludos