finfo_file
finfo_file
finfo::file
Return information about a file
style.procedural
**finfo_file** finfo $finfo string $filename int $flags $context
style.oop
**finfo::file** string $filename int $flags $context
This function is used to get information about a file.
finfo``filenameName of a file to be checked.
flags
One or disjunction of more .
Fileinfo
constants
context
For a description of , refer to .
contexts
Returns a textual description of the contents of the
argument, or false if an error occurred.
filename
Voorbeeld: A example
<?php
$finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type aka mimetype extension
foreach (glob("*") as $filename) {
echo finfo_file($finfo, $filename) . "\n";
}
finfo_close($finfo);
?>
text/html
image/gif
application/vnd.ms-excel
finfo_buffer