nerdexam
Zend

200-530 · Question #475

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…

The correct answer is C. $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 of * if you want to print the root element of the XML file?

Options

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

How the community answered

(29 responses)
  • A
    14% (4)
  • B
    7% (2)
  • C
    76% (22)
  • D
    3% (1)

Community Discussion

No community discussion yet for this question.

Full 200-530 Practice