>>11
$d = new DirectoryIterator('path');//調べたいディレクトのパス
$c = 0;ファイル数
for ($d->rewind(); $d->valid(); $d->next())
{
if ($d->isFile()) $c++;
}