<?php
$dir = "folder";
$start = 0;

if ($handle = opendir($dir)) {
	while (false !== ($file = readdir($handle))) {
		if (is_dir($dir.$file)) {
			$start++;
		}
    	}
	closedir($handle);
}
echo $start . ' folders';
?>
Published in: PHP
Download

Related snippets