$books = $doc->getelementsbytagname( book );
foreach( $books as $book )
{
$authors = $book->getelementsbytagname( author );
$author = $authors->item(0)->nodevalue;
$publishers = $book->getelementsbytagname( publisher );
$publisher = $publishers->item(0)->nodevalue;
$titles = $book->getelementsbytagname( title );
$title = $titles->item(0)->nodevalue;
echo $title - $author - $publisher ;
echo
;
}
?>
xml文件
jack herrington
php hacks
o'reilly
jack herrington
podcasting hacks
o'reilly
