Cita:
Iniciado por GatorV
Mmm leyendo mas a fondo prueba esto:
Código PHP:
$book = $xml->children( "book" );
$title = $book->children( "title" );
echo $title;
Saludos.
Adaptado a mi caso, probe:
$book = $xml->apartado1->children( "sitio" );
$title = $book->children( "nombre" );
sin resultado.
Se esta resistiendo!!!
encontre esto por ahi:
Código:
<?xml version="1.0"?>
<entries xmlns:blog="http://www.edwardbear.org/serendipity/">
<blog:entry>
<blog:name>RPROF - Regular Expression Profiler</blog:name>
</blog:entry>
<blog:entry>
<blog:name>Advanced PHP Programming</blog:name>
</blog:entry>
</entries>
To print out the names of all the different blog entries you could write the following code:
<?php
$entries = simplexml_load_file('syndic.xml');
foreach ($entries->blog->entry as $entry) {
printf("%s\n", $entry->name);
}
?>
y probe:
$book = $xml->prueba->apartado1->sitio;
$title = $book->name;
echo $title;
Tampoco da resultado...