Page 1 of 1

Blank page when using mime_content_type()

Posted: Wed Jul 18, 2007 7:58 pm
by webgroundz
I want to get the type of a file using mime_content_type()
im using PHP Version 5.2.2
here's my sample code:

Code: Select all

echo mime_content_type('wg_logo.gif');
but the result page is blank!

what do you think is the problem?.

thanks all... :) :) :)

Re: Blank page when using mime_content_type()

Posted: Wed Jul 18, 2007 8:26 pm
by John Cartwright
Is that the only thing in the page? If not, that usually means you have a parse error.

What does

Code: Select all

var_dump(mime_content_type('wg_logo.gif'));
var_dump(function_exists('mime_content_type'));
yield?

Reguardless, the function is deprecated. You should be using fileinfo instead

Posted: Wed Jul 18, 2007 9:14 pm
by webgroundz
thanks Jcart, it works fine... :D :D :D