Hi,
The ideas you suggested also break the directory parsing. In other words, I'm only getting one file returned instead of the various files that exist in subdirectories of /images2.
That's the same problem I was having with my attempt. Note that I'm placing your code before my echo statement - I'm pretty green, so I think that may be the problem - syntax?.
But also, your suggested returns the starting directory, /images2 and I want the containing directory of the final .jpg file.
My version gave me that, but then broke the directory parsing - I only get the first file.
Here's what I tried from you (and also tried the other version)
<?php
$it = new RecursiveDirectoryIterator('images2');
$display = Array ( 'jpeg', 'jpg' );
foreach(new RecursiveIteratorIterator($it) as $file)
if ( In_Array ( SubStr ( $file, StrrPos ( $file, '.' ) + 1 ), $display ) == true )
$path = $file->getPath();
$class = basename(dirname($path));
echo '<div class="'.$class.'"><a href="'.$file->getPath().'/'.$file->getFilename().'"rel="shadowbox['.$file->getPath().']">'.'<img src="../slir/w180-h180-c1:1/test/isotope/'.$file->getPath().'/'.$file->getFilename().'" /></a></div>';
?>
Thanks again for your replies, appreciated!