This post will help you to get file type of any uploaded file.
$ftype = $_FILES['userFiles']['type']; // This will get the whole file type like image/jpg,audio/mp3 etc
// Let's get the exact file type. Follow the below code
$file_ext=@split ("\/", $ftype);
$file_ext=$file_ext; // This variable will get the exact file type like image, audio etc
That’s it. Try this code and you will get the exact file type.