finfo_file
    (PECL)
finfo_file -- ファイルについての情報を返す
説明
string 
finfo_file ( resource finfo, string file_name [, int options [, resource context]] )
class 
finfo { 
string 
file ( string file_name [, int options [, resource context]] )
}
   この関数は、ファイルについての情報を返すために使用します。
  
返り値
   filename のテキスト表現、あるいはエラーが発生した場合に
   FALSE を返します。
  
例
   
| 例 1. finfo_file() の例 | 
<?php$finfo = finfo_open(FILEINFO_MIME); // return mime type ala mimetype extension
 foreach (glob("*") as $filename) {
 echo finfo_file($finfo, $filename) . "\n";
 }
 finfo_close($finfo);
 ?>
 | 
 上の例の出力は、たとえば
以下のようになります。 | text/html
image/gif
application/vnd.ms-excel | 
 |