For an upload file type checking , I have implemented:
$_FILES["file"]["type"][$i] == 'application/pdf'
however, this checking will not work on the case I changed the extension name.
So , after some research, I have tried
$finfo = new finfo();
$fileMimeType = $finfo->file($_FILES["file"]["name"][$i] );
OR:
$finfo = finfo_open(FILEINFO_MIME_TYPE);
$fileMimeType = finfo_file($finfo,$_FILES["file"]["name"][$i])
however, $fileMimeType echo nothing.
How to fix the problem? thanks