Note that this function returns the file type (e.g. "file", "dir", etc.) and not the MIME type. To do that, you might want to use this:
<?php
for
(
$dir = new DirectoryIterator('/some/directory');
$dir->valid();
$dir->next()
)
{
$mime = mime_content_type($dir->getPathname());
}
?>