$i = 1;
while(($entry = readdir($dh)))
{
if(is_file($entry))
{
if(substr($entry, 0, 1) != ".")
{
$array[$i] = $entry;
$i += 1;
}
}
}
としてみた。すると