登录 | 注册 | FAQ
Anonymous

What is the best way to know MIME types?

+ 发表回复

2 篇帖子 分页: 1 / 1


What is the best way to know MIME types?

emily008 » 周三 10月 07, 2015 2:57 pm

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

emily008

  • 帖子: 8
  • 注册: 周三 10月 07, 2015 6:29 am
  • 地址: London
--
For more visit HTML Tutorial

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

Farhin Qureshi » 周五 1月 06, 2017 10:38 am

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


The above example will output:

image/gif
text/plain

Thanks.
头像

Farhin Qureshi

  • 帖子: 45
  • 注册: 周二 1月 03, 2017 11:33 am
--
Farhin Qureshi
.NET Developer
http://www.ifourtechnolab.com


+ 发表回复

分页: 1 / 1