this code showing directory only but i want to show directory with counts files inside the folder
example count files inside the folder
- FolderA (2 Files Found)
- FolderB (19 Files Found)
- FolderD (1 Files Found)
FolderD (13 Files Found)
function folderlist(){ $startdir = './'; $ignoredDirectory[] = '.'; $ignoredDirectory[] = '..'; if (is_dir($startdir)){ if ($dh = opendir($startdir)){ while (($folder = readdir($dh)) !== false){ if (!(array_search($folder,$ignoredDirectory) > -1)){ if (filetype($startdir . $folder) == "dir"){ $directorylist[$startdir . $folder]['name'] = $folder; $directorylist[$startdir . $folder]['path'] = $startdir; } } } closedir($dh); } } return($directorylist); } $folders = folderlist(); foreach ($folders as $folder){ $path = $folder['path']; $name = $folder['name']; echo '<li><a href="' .$path .'index.php?album=' .$name . '" class="style1"><font face="Tahoma" class="ws10"><B>' . $name . '</B></a><br /></li>'; } ?>