proceed with caution
as the documentation already says
FILEINFO_MIME will output something like "image/jpeg; charset=binary"
while
FILEINFO_MIME_TYPE outputs "image/jpeg"
and
FILEINFO_MIME_ENCODING outputs "binary"
下列常量由此扩展定义,且仅在此扩展编译入 PHP 或在运行时动态载入时可用。
FILEINFO_NONE
(int)
FILEINFO_SYMLINK
(int)
FILEINFO_MIME_TYPE
(int)
FILEINFO_MIME_ENCODING
(int)
FILEINFO_MIME
(int)
FILEINFO_COMPRESS
(int)
FILEINFO_DEVICES
(int)
FILEINFO_CONTINUE
(int)
FILEINFO_PRESERVE_ATIME
(int)
FILEINFO_RAW
(int)
\ooo
八进制表示格式。
FILEINFO_EXTENSION
(int)
JPEG
将会返回多个扩展名,以斜线分隔,比如
"jpeg/jpg/jpe/jfif"
。如果在 magic.mime
数据库里类型未知,则返回的是 "???"
。
PHP 7.2.0 起有效。
proceed with caution
as the documentation already says
FILEINFO_MIME will output something like "image/jpeg; charset=binary"
while
FILEINFO_MIME_TYPE outputs "image/jpeg"
and
FILEINFO_MIME_ENCODING outputs "binary"