MIME::typeForExt
Return the MIME type matching a specified file extension
Synopsis
uses('mime');
public static function MIME::typeForExt(string [in] $ext)
Description
MIME::typeForExt() attempts to resolve a file extension to a MIME
type.
The file extension, $ext, may be specified with or without a
leading dot.
If the file extension could not be mapped to a MIME type, null
is returned.
Example
Parameters
| Name | Direction | Type | Description |
|---|---|---|---|
$ext
| in | string | The file extension to resolve to a MIME type |
Return Value
string The MIME type matching $ext, if it could be resolved, or null otherwise.