x
 
<!DOCTYPE html>
<html>
<body>
<?php
$xml=simplexml_load_file("/demo/xml/books.xml") or die("错误:无法创建对象");
echo $xml->book[0]['category'] . "<br>";
echo $xml->book[1]->title['lang'];
?>
</body>
</html>