ok I got all the paths but how do I display the images in there own divs while limiting how much is displayed in those divs and still be able to us the more images link. I am really sorry for the noob question, but I have 0% knowledge about PHP OOP. Is there a way to do this with procedural coding?
This is what I got so far
$startpath = 'upload/';
$ritit = new RecursiveIteratorIterator(new RecursiveDirectoryIterator($startpath, RecursiveDirectoryIterator::SKIP_DOTS), RecursiveIteratorIterator::CHILD_FIRST);
$r = array();
foreach ($ritit as $splFileInfo) {
$path = $splFileInfo->isDir()
? array($splFileInfo->getFilename() => array())
: array($splFileInfo->getFilename());
for ($depth = $ritit->getDepth() - 1; $depth >= 0; $depth--) {
$path = array($ritit->getSubIterator($depth)->current()->getFilename() => $path);
}
$r = array_merge_recursive($r, $path);
}
echo '<pre>';
print_r($r);
echo '</pre>';