xpath.php 166 B

123456789
  1. <?php
  2. $books = simplexml_load_file('book.xml');
  3. $xpath_result = $books->xpath("/books/book/title");
  4. foreach($xpath_result as $entry ) {
  5. print "$entry \n";
  6. }
  7. ?>