Possible Duplicate:
How do I determine the extension(s) associated with a MIME type in PHP?
I'm aware of how to get the MIME type of a given file, but is there a way to do it given only an extension?
Example input:
jpg
Example output:
image/jpeg
Possible Duplicate:
How do I determine the extension(s) associated with a MIME type in PHP?
I'm aware of how to get the MIME type of a given file, but is there a way to do it given only an extension?
Example input:
jpg
Example output:
image/jpeg
try this to get info about which extension is which mime type, but of course please be aware that this won't be very accurate (e.g. possible gif file on png extension..)
The most elegant solution I've seen for Apache environments is http://www.php.net/manual/en/function.mime-content-type.php#107798
I don't have the Fileinfo extension installed, but from PHP documentation, it seems like Fileinfo might give you that information, which was previously given by the deprecated function mime_content_type()