Options +Indexes
function GetSubDirCount($path) { $path.="/"; $cnt = 0; if (($fp = opendir($path))!==false) { while (($t = readdir($fp))!==false) { if (is_dir($path.$t)) $cnt++; } closedir($fp); } return $cnt; } echo GetSubDirCount("c:");