I'm just curious to know why mime_content_type() is now considered deprecated.
This method for determining the mime type is much easier than the replacement Fileinfo functionality.
I'm just curious to know why mime_content_type() is now considered deprecated.
This method for determining the mime type is much easier than the replacement Fileinfo functionality.
I guess it's because fileinfo can return more information about files.
EDIT: Here is a replacement hack:
function _mime_content_type($filename)
{
$result = new finfo();
if (is_resource($result) === true)
{
return $result->file($filename, FILEINFO_MIME_TYPE);
}
return false;
}
What if you don't even have finfo support nor mime-magic support, at least like I do with this precompiled plesk environment, why do they want to make life harder php is not supposed to be like ASP.