I’m looking for the best (possible on most PHP 5.2 installs and still actively developed) way to detect a files MIME type in PHP.
I’m aware of the mime_content_type() method and the Fileinfo extension, however mime_content_type() is unreliable and deprecated, and Fileinfo doesn’t come in a ‘standard’ PHP (5.2) install.
Do I have any other options?
Have you looked into this PEAR package?
http://pear.php.net/package/MIME_Type