I am using this code to list the name of ll existing Folders in a Directory but it is returning all folders, images, files (everything) in the directory.
<?php // open this directory $myDirectory = opendir($_SERVER['DOCUMENT_ROOT'] . "/."); $list = 0; while (false !== ($entryName = readdir($myDirectory))) { if ($entryName != "." && $entryName != ".." && $entryName != ".DS_Store") { $dirArray[] = $entryName; } } How can I modify it to get ONLY Folders Name in the directory?