<?php
$map = Array
(
0 => "test.txt",
'two' => Array
(
0 => "test.txt",
'testing' => Array
(
0 => "testagain.txt"
)
),
"three" => Array
(
0 => "testthree.txt"
),
1 => "test.txt",
"one" => Array
(
0 => "testone.txt",
"subone" => Array
(
0 => "testsubone.txt"
)
)
);
function print_dir($in)
{
foreach ($in as $k => $v)
{
if (!is_array($v))
echo "[file]: ",$v,"\n";
else
echo "[directory]: ",$k,"\n",print_dir($v);
}
}
print_dir($map);