nerdexam
Zend

ZF-100-500 · Question #176

You run the following PHP script: <?php include("xml.inc"); if (!$dom = domxml_open_mem($xmlstr)) { echo "Error while parsing the XML document \n"; exit; } $a = ********* print_r($a); ?> Which of…

The correct answer is B. $dom->document_element(). See the full explanation below for the reasoning.

Question

You run the following PHP script: <?php include("xml.inc"); if (!$dom = domxml_open_mem($xmlstr)) { echo "Error while parsing the XML document \n"; exit; } $a = ********** print_r($a); ?> Which of the following functions will you use instead o f * if you want to print the root element of the XML file?

Options

  • A$node->parent_node();
  • B$dom->document_element();
  • C$dom->root_node();
  • D$dom->root_element();

How the community answered

(51 responses)
  • A
    2% (1)
  • B
    84% (43)
  • C
    10% (5)
  • D
    4% (2)

Community Discussion

No community discussion yet for this question.

Full ZF-100-500 Practice