How to make dir tree from array
<p>I haw got a array of directory's that i wont to use for the directory tree with this code below... My question is how to make a tree from this array? With this code I get this: </p>

<pre><code>Array (
    [0] =&gt; store/555555//Osnovni documenti
    [1] =&gt; store/555555//Ostali dokumenti
    [2] =&gt; store/555555//Pictures )
</code></pre>

<p>NOW how to inplement this ?sou I can get the directory tree ? Is ther something that can do that? </p>

<pre><code>echo"&lt;pre&gt;";

function make_tree_recursive($path, $levels){
//where $path is your source dir, $levels is the maximum recursives
    $handle=opendir($path);
    while($a=readdir($handle)){
      if(!preg_match('/^\./',$a)){
        $full_path="$path/$a";
        $list[]=$full_path;

        if((is_dir($full_path))&amp;&amp;(!preg_match('/(\/.+){'.$levels.',}/',$full_path))){
          $recursive=make_tree_recursive($full_path, $levels);
          for($n=0; $n&lt;count($recursive); $n++){
              $list[]=$recursive[$n];
          }
        }
      }
    }

    closedir($handle);
    return $list;
}

$list = make_tree_recursive("store/".$diro."/", 3);
print_r ($list);
echo"&lt;/pre&gt;";
</code></pre>
