tengo esta funcion que extrae el ultimo feed de una pag RSS que le pase..
Código PHP:
function CargarXML($ruta_fichero)
{
$contenido = "";
if($da = fopen($ruta_fichero,"r"))
{
while ($aux= fgets($da,1024))
{
$contenido.=$aux;
}
fclose($da);
}
else
{
echo "Error: no se ha podido leer el archivo <strong>$ruta_fichero</strong>";
exit;
}
$tagnames = array ("title","description","link");
if (!$xml = domxml_open_mem($contenido))
{
echo "Ha ocurrido un error al procesar el documento<strong> \"$ruta_fichero\"</strong> a XML <br>";
exit;
}
else
{
$raiz = $xml->document_element();
$tam=sizeof($tagnames);
for($i=0; $i<$tam; $i++)
{
$nodo = $raiz->get_elements_by_tagname($tagnames[$i]);
$j=0;
foreach ($nodo as $etiqueta)
{
$matriz[$j][$tagnames[$i]]=$etiqueta->get_content();
$j++;
}
}
return $matriz;
}
}
Si alguien me puede ayudar.. le estaria muy agradecido
![Afirmando](http://static.forosdelweb.com/fdwtheme/images/smilies/afirmar.gif)
![sonriente](http://static.forosdelweb.com/fdwtheme/images/smilies/smile.png)