XML Path in action : XML Path : XML PHP Source Code


PHP Source Code » XML » XML Path »

 

XML Path in action




<?php
   $xml = simplexml_load_file("contact.xml");
   $authors = $xml->xpath("/contact/personal/title");
   foreach($authors AS $author) {
      echo "$author<br />";
   }
?>
<!--
<contact id="43956">
     <personal>
          <name>
               <first>J</first>
               <middle>J</middle>
               <last>J</last>
          </name>
          <title>Manager</title>
          <employer>National Company</employer>
          <dob>1951-02-02</dob>
     </personal>
</contact>


-->
           
       



HTML code for linking to this page:

Follow Navioo On Twitter

PHP Source Code

 Navioo XML
» XML Path