Zend
200-530 · Question #80
What will be the output of the following PHP script? <?php include("xml.inc"); if (!$dom = domxml_open_mem($xmlstr)) { echo "Error while parsing the XML document\n"; exit; } $a =…
The correct answer is D. It will display the root element of the XML file. See the full explanation below for the reasoning.
Question
What will be the output of the following PHP script? <?php include("xml.inc"); if (!$dom = domxml_open_mem($xmlstr)) { echo "Error while parsing the XML document\n"; exit; } $a = $dom->document_element(); print_r($a); ?>
Options
- AIt will display the XML code of the XML file.
- BIt will throw an error.
- CIt will display the contents of the XML file.
- DIt will display the root element of the XML file.
How the community answered
(48 responses)- A10% (5)
- B2% (1)
- C4% (2)
- D83% (40)
Community Discussion
No community discussion yet for this question.