The finfo
function is returning crazy mime types. Look the following code, what is going on?
<?php
$files = array ("css.css", "index.html", "js.js", "png.png");
$info = finfo_open (FILEINFO_MIME_TYPE);
for ($i = 0; $i < count ($files); $i ++) {
$type = finfo_file ($info, $files[$i]);
$files[$i] = $type;
}
finfo_close ($info);
echo $files[0]; // text/x-c -> WHAT ?!
echo $files[1]; // text/html -> Ok !
echo $files[2]; // text/x-c++ -> WHAT ?!
echo $files[3]; // image/png -> Ok !
?>
Thanks
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…