x
 
<!DOCTYPE html>
<html>
<body>
<?php
$xml=simplexml_load_file("books.xml") or die("错误:无法创建对象");
foreach($xml->children() as $books) {
        echo $books->title . ", ";
        echo $books->author . ", ";
        echo $books->year . ", ";
        echo $books->price . "<br>";
}
?>
</body>
</html>