Login | Register | FAQ
Anonymous

What is the best way to know MIME types?

+ Post a reply

2 posts Page 1 of 1


What is the best way to know MIME types?

by emily008 » Wed Oct 07, 2015 2:57 pm

What is the best way to find the MIME type of a file? Please give the PHP code.
User avatar

emily008

  • Posts: 8
  • Joined: Wed Oct 07, 2015 6:29 am
  • Location: London
--
For more visit HTML Tutorial

Re: What is the best way to know MIME types?

by Farhin Qureshi » Fri Jan 06, 2017 10:38 am

Hi Emily008
You can use the following code to know MIME type:
Code: Select all
<?php
echo mime_content_type('php.gif') . "\n";
echo mime_content_type('test.php');
?>


The above example will output:

image/gif
text/plain

Thanks.
User avatar

Farhin Qureshi

  • Posts: 45
  • Joined: Tue Jan 03, 2017 11:33 am
--
Farhin Qureshi
.NET Developer
http://www.ifourtechnolab.com


+ Post a reply

Page 1 of 1