He conseguido mostrar los datos del XML en formato array
Código php:
Ver original<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<title>Analizar XML</title>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
</head>
<body>
<?php
class xml {
var $resultado;
var $informacion;
function xml($contenido) {
$this->informacion = xml_parse($this->resultado,$contenido);
return $this->matriz;
}
function abrir($parser, $nombre, $atributos) {
$etiqueta = array("nombre"=>$nombre,"atributos"=>$atributos); }
function info($parser, $etiqueta_info) {
if(trim($etiqueta_info)) { if(isset($this->matriz[count($this->matriz)-1]['info'])) { $this->matriz[count($this->matriz)-1]['info'] .= $etiqueta_info; }
else {
$this->matriz[count($this->matriz)-1]['info'] = $etiqueta_info; }
}
}
function cerrar($parser, $nombre) {
$this->matriz[count($this->matriz)-2]['hijo'][] = $this->matriz[count($this->matriz)-1]; }
}
$url = "http://partnerfeed.itsfogo.com/partnerfeed.aspx?partnerfeedID=1305&ZoneID=34296&partnerTargetLink=&partnerField=itsfogoTargetLink";
$xml = new xml($xml_contenido);
echo '<pre>';
echo '</pre>';
?>
</body>
</html>
Ahora me falta acceder a cada una de las posiciones y guardar los datos en un base de datos mysql.
¿Alguna sugerencia?
Gracias