Why is mime_content_type() deprecated in PHP?

后端 未结 5 1227
悲&欢浪女
悲&欢浪女 2020-11-28 11:06

I\'m just curious to know why mime_content_type() is now considered deprecated.

This method for determining the mime type is much easier than the replacement Fileinf

5条回答
  •  無奈伤痛
    2020-11-28 11:39

    Another way is to pass to the constructor constant FILEINFO_MIME.

    $finfo = new finfo(FILEINFO_MIME);
    $type  = $finfo->file('path/filename');
    

提交回复
热议问题