Location: PHPKode > scripts > Path To XML > path-to-xml/test.php
<?php
   /**
   * Usage of PathToXml Class
   * @PHPVER  :  5.0
   * @author  :  MA Razzaque Rupom <hide@address.com>, <hide@address.com>
   * @version : 1.0
   * Purpose  : Creating XML File of Hierarchy Structure of A Given Directory
   */

     include_once "path_to_xml.class.php";
     
     $path = "d:/apache/htdocs/wordpress";
     
     //Path to Array
     $Obj = new PathToXml($path);
     $Obj->traverseDirFiles($path);
     $Obj->showDirHierarchy();

     //Array to XML
     $Obj->setArray($Obj->arr);     
     $xml_file = "test.xml"; 
     if ($Obj->saveArray($xml_file))
     {
        echo "<p><b>Array Converted To XML And Saved As $xml_file </b></p>";
     }

?>
Return current item: Path To XML