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 22/36

    You have given the following XML data in the tasks.XML file:

    
    <?xml version="1.0" encoding="ISO-8859-1"?>
     <tasklist>
           <note>
              <tasks>Validate data</tasks>
              <details>String Validation</details>
           </note>
           <note>
              <tasks>Secure data</tasks>
              <details>Encryption</details>
           </note>
     </tasklist> 
    
    Now, you run the following PHP script:
    
    <?php
       $objDOM = new DOMDocument();
       $objDOM->load("tasks.xml"); 
       $note $objDOM->getElementsByTagName("note");
       foreach( $note as $value )
       {
            $tasks $value->getElementsByTagName("tasks");
            $task  $tasks->item(0)->nodeValue;
            $details $value->getElementsByTagName("details");
            $detail  $details->item(0)->nodeValue;
            echo "$task :: $detail ";
       }
     ?>
    
    
    What should be displayed when this script is executed?