Query: finfo_file
OS: php
Section: 3
Format: Original Unix Latex Style Formatted with HTML and a Horizontal Scroll Bar
FINFO_FILE(3) 1 FINFO_FILE(3) finfo_file - Return information about a file Procedural styleSYNOPSISstring finfo_file NULL NULL (resource $finfo, string $file_name, [int $options = FILEINFO_NONE], [resource $context])DESCRIPTIONObject oriented style string finfo::file NULL NULL (string $file_name, [int $options = FILEINFO_NONE], [resource $context]) This function is used to get information about a file.PARAMETERSo $finfo - Fileinfo resource returned by finfo_open(3). o $file_name - Name of a file to be checked. o $options - One or disjunction of more Fileinfo constants. o $context - For a description of contexts, refer to "Stream Functions".RETURN VALUESReturns a textual description of the contents of the $file_name argument, or FALSE if an error occurred.EXAMPLESExample #1 A finfo_file(3) example <?php $finfo = finfo_open(FILEINFO_MIME_TYPE); // return mime type ala mimetype extension foreach (glob("*") as $filename) { echo finfo_file($finfo, $filename) . " "; } finfo_close($finfo); ?> The above example will output something similar to: text/html image/gif application/vnd.ms-excelSEE ALSOfinfo_buffer(3). PHP Documentation Group FINFO_FILE(3)