Home >Backend Development >PHP Tutorial >php获取文件mimeType

php获取文件mimeType

WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWB
WBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOYWBOriginal
2016-06-23 13:10:101414browse

   /**        *获取文件mimeType    */    function getFileMimeType($fileName)    {        if (phpversion() >= '5.3.0')         {                $finfo = finfo_open(FILEINFO_MIME);            $mimeType = finfo_file($finfo, $fileName);            finfo_close($finfo);        }        else         {            $mimeType = mime_content_type($fileName);        }            return $mimeType;    }





Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn