exam questions

Exam 200-550 All Questions

View all questions & answers for the 200-550 exam

Exam 200-550 topic 1 question 164 discussion

Actual exam question from Zend's 200-550
Question #: 164
Topic #: 1
[All 200-550 Questions]

Consider the following XML code:
<?xml version="1.0" encoding="utf-8"?>
<books>
<book id="1">PHP 5.5 in 42 Hours</book>
<book id="2">Learning PHP 5.5 The Hard Way</book>
</books>
Which of the following SimpleXML calls prints the name of the second book?
(Let $xml = simplexml_load_file("books.xml"); .) (Choose 2)

  • A. echo $xml->books->book[2];
  • B. echo $xml->books->book[1];
  • C. echo $xml->book[1];
  • D. echo $xml->xpath("/books/book[@id=2]");
  • E. $c = $xml->children(); echo $c[1];
Show Suggested Answer Hide Answer
Suggested Answer: CE 🗳️

Comments

Chosen Answer:
This is a voting comment (?). It is better to Upvote an existing comment if you don't have anything to add.
Switch to a voting comment New
Currently there are no comments in this discussion, be the first to comment!
Community vote distribution
A (35%)
C (25%)
B (20%)
Other
Most Voted
A voting comment increases the vote count for the chosen answer by one.

Upvoting a comment with a selected answer will also increase the vote count towards that answer by one. So if you see a comment that you already agree with, you can upvote it instead of posting a new comment.

SaveCancel
Loading ...
exam
Someone Bought Contributor Access for:
SY0-701
London, 1 minute ago