Zend
200-530 · Question #472
What is the work of simplexml_import_dom() in the following PHP code? <?php $dom = new domDocument; $dom->loadXML('<email><from>John</from></email>'); $xml = simplexml_import_dom($dom); echo…
The correct answer is D. It gets a SimpleXMLElement object from a DOM node. See the full explanation below for the reasoning.
Question
What is the work of simplexml_import_dom() in the following PHP code? <?php $dom = new domDocument; $dom->loadXML('<email><from>John</from></email>'); $xml = simplexml_import_dom($dom); echo $xml->from; ?>
Options
- AIt gets the name of a SimpleXML element.
- BIt gets the namespaces from XML data.
- CIt gets a SimpleXMLElement object from an XML document.
- DIt gets a SimpleXMLElement object from a DOM node
How the community answered
(17 responses)- A6% (1)
- B6% (1)
- C18% (3)
- D71% (12)
Community Discussion
No community discussion yet for this question.