finfo_close
finfo_open
Fileinfo Funktionen
PHP Manual

# finfo_file

(PECL fileinfo:0.1-1.0.4)

finfo_file — Return information about a file

### Beschreibung

string finfo_file ( resource `$finfo` , string `$file_name` [, int `$options` [, resource `$context` ]] )
finfo
string file ( string `$file_name` [, int `$options` [, resource `$context` ]] )

This function is used to get information about a file.

### Parameter-Liste

`finfo`

  Fileinfo resource returned by finfo_open().

`file_name`

  Name of a file to be checked.

`options`

  One or disjunction of more Fileinfo constants.

`context`

  For a description of contexts, refer to Stream Funktionen.

### Rückgabewerte

Returns a textual description of the contents of the `filename` argument, or `FALSE` if an error occurred.

### Beispiele

Beispiel #1 A finfo_file() example

`<?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);
?>`

Das oben gezeigte Beispiel erzeugt eine ähnliche Ausgabe wie:

    text/html
    image/gif
    application/vnd.ms-excel

### Siehe auch

- finfo_buffer()

finfo_close
finfo_open
Fileinfo Funktionen
PHP Manual