php验证文件mime类型的函数mime_content_type

admin 阅读:110 2024-03-23

php 的 mime_content_type 函数可以返回文件的类型,用法如下:

<?php
echo mime_content_type('php.gif');
echo mime_content_type('test.php');
?>

输出:

image/gif
text/plain
声明

1、部分文章来源于网络,仅作为参考。
2、如果网站中图片和文字侵犯了您的版权,请联系1943759704@qq.com处理!