How to get MIME type of a file in PHP 5.5?

前端 未结 8 1921
鱼传尺愫
鱼传尺愫 2020-11-30 07:10

I am using mime_content_type() in PHP 5.5 to get a MIME type, but it throws fatal: error function not found.

How can I achieve this on PHP

8条回答
  •  感情败类
    2020-11-30 07:48

    Make use of the finfo() functions.

    A simple illustration:

    OUTPUT :

    image/gif
    

    Note : Windows users must include the bundled php_fileinfo.dll DLL file in php.ini to enable this extension.

提交回复
热议问题