So far ive gotten this down but it displays the contents for all the folders not just the last one. Ive tried using end(); on the list but that didnt work.
function listFolderFiles($dir){
$ffs = scandir($dir);
$i = 0;
$list = array();
foreach ( $ffs as $ff ){
if ( $ff != '.' && $ff != '..' ){
if ( strlen($ff)>=5 ) {
$list[] = $ff;
//echo dirname($ff) . $ff . "<br/>";
echo $dir.'/'.$ff.'<br/>';
}
if( is_dir($dir.'/'.$ff) )
listFolderFiles ($dir.'/'.$ff);
}
}
return $list;
}
$files = array();
$files = listFolderFiles(dirname(__FILE__));
lets say for instance i have a folder and within it i have folders named as such
I want it to always pick the last folder, and display its contents which are images.