Well where have you got to so far?
You open the directory with opendir()
Get the contents with readdir()
Check if its a directory with is_dir()
So you could do something like this:
<?php
$dir = '' // the directory
$num_dirs = 0;
if ($dir = opendir($dir))
{
while (($file = readdir($dir)) !== false)
{
if(is_dir($file) AND $file != "." AND $file != "..")
{
$num_dirs++;
}
}
closedir($dir);
$total = $num_dirs;
}
?>