Alternative to mime_content_type()

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
shanecody
Forum Newbie
Posts: 23
Joined: Fri May 08, 2009 4:12 pm

Alternative to mime_content_type()

Post by shanecody »

In my code i have the following:

Code: Select all

$type = mime_content_type($_FILES[$file_upload]['tmp_name']);
What would be a good alternative to this line of code now that mime_content_type is depreciated?
User avatar
requinix
Spammer :|
Posts: 6617
Joined: Wed Oct 15, 2008 2:35 am
Location: WA, USA

Re: Alternative to mime_content_type()

Post by requinix »

shanecody wrote:What would be a good alternative to this line of code now that mime_content_type is depreciated?
This function has been deprecated as the PECL extension Fileinfo provides the same functionality (and more) in a much cleaner way.
Perhaps the Fileinfo extension?
Post Reply