Zend PHP 5.3 Certification Exam


1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36
  • Question 29/36

    You have been given the following PHP script:

    
    <?php
    $xmlstring = <<<XML 
    <?xml version="1.0" encoding="ISO-8859-1"?> 
    <email> 
    <to>[email protected]</to> 
    <from>[email protected]</from>
    <heading>Technical issue in Linux OS</heading>
    <body>There is a technical issue in my Linux system. Please Fix it. </body>
    </email>
    XML;
    $xml = new SimpleXMLElement($xmlstring);
    foreach($xml->children() as $child)
      {
    <Insert code here.>
      }
     ?>
    
    Which of the following code snippets will you insert at line number 12 to get the following output?
    
    to: [email protected]
     from: [email protected]
     heading: Technical issue in Linux OS
     body: There is a technical issue in my Linux system. please Fix it.