I have application on a live server where I want to check upload file is image or not. In my localhost and other live server following functions are working except one current server.
1. mime_content_type($file);
2. $file_type = exec("file $file");
3. $finfo = new finfo(FILEINFO_MIME);
$file_type = $finfo->file($_FILES['image']['tmp_name']);
Some are deprecated, some are disabled due to security reasons. Can I have other methods/techniques to get file type which is used to check whether upload file is image or not?