Get attribute values - loop


SUBMITTED BY: henry1874w

DATE: June 21, 2017, 11:59 p.m.

FORMAT: Text only

SIZE: 239 Bytes

HITS: 199

  1. <!DOCTYPE html>
  2. <html>
  3. <body>
  4. <?php
  5. $xml=simplexml_load_file("books.xml") or die("Error: Cannot create object");
  6. foreach($xml->children() as $books) {
  7. echo $books->title['lang'];
  8. echo "<br>";
  9. }
  10. ?>
  11. </body>
  12. </html>

comments powered by Disqus