I would like to use opendir() to list only the folders in a particular folder (i.e. /www/site/). I would like to exclude files from the list as well at the '.' and '..' folders that appear on a linux folder listing. How would I go about doing this?
foreach(glob('directory/*', GLOB_ONLYDIR) as $dir) {
$dir = str_replace('directory/', '', $dir);
echo $dir;
}
You can use simply glob with GLOB_ONLYDIR and then filter resulted directories