🔥码云GVP开源项目 12k star Uniapp+ElementUI 功能强大 支持多语言、二开方便! 广告
本模块中的函数通过在文件的给定位置查找特定的*魔术*字节序列 来猜测文件的内容类型以及编码。 虽然不是百分百的精确, 但是通常情况下能够很好的工作。 从 PHP 5.3.0 开始,本扩展是默认开启的 * [预定义常量](https://www.php.net/manual/zh/fileinfo.constants.php) * [Fileinfo 函数](https://www.php.net/manual/zh/ref.fileinfo.php) * [finfo\_buffer](https://www.php.net/manual/zh/function.finfo-buffer.php)— 返回一个字符串缓冲区的信息 * [finfo\_close](https://www.php.net/manual/zh/function.finfo-close.php)— 关闭 fileinfo 资源 * [finfo\_file](https://www.php.net/manual/zh/function.finfo-file.php)— 返回一个文件的信息 * [finfo\_open](https://www.php.net/manual/zh/function.finfo-open.php)— 创建一个 fileinfo 资源 * [finfo\_set\_flags](https://www.php.net/manual/zh/function.finfo-set-flags.php)— 设置 libmagic 配置选项 * [mime\_content\_type](https://www.php.net/manual/zh/function.mime-content-type.php)— 检测文件的 MIME 类型 * [finfo](https://www.php.net/manual/zh/class.finfo.php)— finfo 类 * [finfo::buffer](https://www.php.net/manual/zh/finfo.buffer.php)— 别名 finfo\_buffer() * [finfo::\_\_construct](https://www.php.net/manual/zh/finfo.construct.php)— 别名 finfo\_open * [finfo::file](https://www.php.net/manual/zh/finfo.file.php)— 别名 finfo\_file() * [finfo::set\_flags](https://www.php.net/manual/zh/finfo.set-flags.php)— 别名 finfo\_set\_flags()