Zend
200-530 · Question #16
You have been given the following code snippet: <?php $string = <<<XML <?xml version="1.0" encoding="ISO-8859-1"?> <email> <heading>Technical issue in Linux OS</heading> <body>There is a technical…
The correct answer is B. $xml = simplexml_load_string($string). See the full explanation below for the reasoning.
Question
You have been given the following code snippet: <?php $string = <<<XML <?xml version="1.0" encoding="ISO-8859-1"?> <email> <heading>Technical issue in Linux OS</heading> <body>There is a technical issue in my Linux system. Please Fix it. </body> </email> XML; <Write code here> ?> Which of the following code snippets will you write to print the XML content?
Options
- A$xml = XML_string($string);
- B$xml = simplexml_load_string($string);
- C$xml = load_XML($string);
- D$xml = simplexml_string($string);
How the community answered
(35 responses)- A11% (4)
- B80% (28)
- C3% (1)
- D6% (2)
Community Discussion
No community discussion yet for this question.