I have a sever which people can upload files to. The problem is that some of the filenames are mangled (dont have any extension) and so I cannot immediately determine file type.
You can try to load the image into PHP's GD library, and see if it works.
$file = file_get_contents('file'); $img = imagecreatefromstring($file); if($img === FALSE){ // file is NOT an image } else{ // file IS an image }