Sticky Posts
May 31, 2009
PHP Get MIME Type | Windows + *nix Compatible
How To Get MIME Type In PHP
Many methods to do this in PHP ... none works consistently (Windows and such). So I had to create my own. It uses an external file it loads just once per session using a static variable. Each later call uses the static var so no reload. The external file's called mimes.vexp which is an array exported with var_export. The function is below and the file is linked inside the function code (right click - Save As). Use notepad to open/edit it. Put this function within reach as the next function I'll publish uses it.
Make sure mimes.vexp is in the same directory with the php file that contains this function.
The PHP Function Script
Registration is quick, painless and worth its weight in gold.
Have fun!


Thanks! This is very useful :)