Forum und email

Fileinfo Functions

簡介

The functions in this module try to guess the content type and encoding of a file by looking for certain magic byte sequences at specific positions within the file. While this is not a bullet proof approach the heuristics used do a very good job.

需求

magic_open library is needed to build this extension.

安裝

安裝此 PECL 擴充功能的訊息可在手冊中標題為 PECL 擴充功能安裝的一章中找到。 更多訊息如新版本,下載,原始文件,維護者訊息以及更新日誌等可以在這裡找到: » https://pecl.php.net/package/fileinfo

執行時期設定

本擴充功能在 php.ini 中未定義任何設定選項。

資源類型

There is one resource used in Fileinfo extension: a magic database descriptor returned by finfo_open().

預設常數

以下常數由擴充功能定義,因此只有在擴充功能被編譯到 PHP 中,或者在執行時被動態載入後才有效。

FILEINFO_NONE (integer)
No special handling.
FILEINFO_SYMLINK (integer)
Follow symlinks.
FILEINFO_MIME (integer)
Return a mime string, instead of a textual description.
FILEINFO_COMPRESS (integer)
Decompress compressed files.
FILEINFO_DEVICES (integer)
Look at the contents of blocks or character special devices.
FILEINFO_CONTINUE (integer)
Return all matches, not just the first.
FILEINFO_PRESERVE_ATIME (integer)
If possible preserve the original access time.
FILEINFO_RAW (integer)
Don't translate unprintable characters to a \ooo octal representation.

Table of Contents