I was thinking of using RecursiveIteratorIterator to display the "top-directories", in my example layout and puffar, but I cannot get it to work. The structure is as follows:
| images |
=> layout
=>lab
=> puffar
and the result is
layout
layout
layout
layout/lab
layout/lab
puffar
puffar
$directory = 'images';
$it = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($directory));
while($it->valid()) {
if (!$it->isDot()) {
echo $it->getSubPath() . "
";
}
$it->next();
}
another thing that I cannot get to work is if I change the directory path to
$directory = 'newsletter.site.se/images';
it is not displaying anything. It would be fantasic if someone could help me. thanks linda