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());
}
?>
DirectoryIterator::getType
(PHP 5 >= 5.0.2)
DirectoryIterator::getType — ファイルタイプを取得する
説明
string DirectoryIterator::getType
( void
)
警告
この関数は、 現在のところ詳細な情報はありません。引数のリストのみが 記述されています。
ファイルタイプを取得します。
パラメータ
この関数にはパラメータはありません。
返り値
ファイルタイプを返します。
DirectoryIterator::getType
boards at gmail dot com
10-Apr-2006 01:09
10-Apr-2006 01:09
