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.
For the first question is extension is known you could use the PHP function in_array() Documentation
in_array()