= 4.3.0, PHP 5, PHP 7, PHP 8)mime_content_type — 檢測(cè)文件的 MIME 類型說(shuō)明mime_content_type(string $filename): string返回通過(guò)使用 magic.mime ">
(PHP 4 >= 4.3.0, PHP 5, PHP 7, PHP 8)
mime_content_type — 檢測(cè)文件的 MIME 類型
$filename): string返回通過(guò)使用 magic.mime 檢測(cè)到的文件 MIME 類型。
filename要檢測(cè)的文件名。
   返回文件的 MIME 內(nèi)容類型,例如
   text/plain 或 application/octet-stream。 或者在失敗時(shí)返回 false。
  
失敗時(shí)拋出E_WARNING警告。
示例 #1 mime_content_type() 示例
<?php
echo mime_content_type('php.gif') . "\n";
echo mime_content_type('test.php');
?>
以上例程會(huì)輸出:
image/gif text/plain