You are here:Home
  • Narrow screen resolution
  • Wide screen resolution
  • Decrease font size
  • Default font size
  • Increase font size
  • default color
  • green color
  • blue color

Getting MIME of remote file with Zend Framework

Friday, 09 April 2010
If you ever need to get content type of remote file from within PHP, this class will come in handy. Supposing you need to check external link if it is an mp3 file. You will be able to do this:
$sniffer = new Smartycode_Http_Mime(); 
$contentType = $sniffer->getMime($url); 
if('audio/mpeg3' == $contentType) echo 'It is MP3';
View solution now by giving credit to author




Reddit!Del.icio.us!Facebook!Slashdot!Netscape!Technorati!StumbleUpon!
Last Updated ( Friday, 09 April 2010 )

Add comment


Security code
Refresh

< Prev   Next >