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
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With