The following XML document is in books.xml. Which code will output “Historical”?

  • $books = simplexml_load_string(‘books.xml’); echo $books->book[0]->categories->category[1];
  • $books = simplexml_load_file(‘books.xml’); echo $books->book[0]->categories->category[1];
  • $books = SimpleXMLElement(‘books.xml’); echo $books->book[0]->categories->category[1];
  • $books = SimpleXML(‘books.xml’); echo $books->book[0]->categories->category[1];
Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Leave a Comment

Join our list

Subscribe to our mailing list and get interesting stuff and updates to your email inbox.

Thank you for subscribing.

Something went wrong.

Send this to a friend