get_mime_by_extension($filename)
Parameters: |
|
---|---|
Returns: |
MIME type string or FALSE on failure |
Return type: |
string |
Translates a filename extension into a MIME type based on config/mimes.php. Returns FALSE if it can’t determine the type, or read the MIME config file.
$file = 'somefile.png'; echo $file.' is has a mime type of '.get_mime_by_extension($file);
Note
This is not an accurate way of determining file MIME types, and is here strictly for convenience. It should not be used for security purposes.
Please login to continue.