It\'s not always a good idea to rely on $_FILES[][\'type\'] because this is simply the MIME type the client browser has given. This can potentially be faked by a client and browsers can also report the incorrect MIME type or give a generic MIME type.
You can use the getimagesize() function to get the MIME type of an image:
list($x,$x,$mime_type) = getimagesize($_FILES[\'files\'][\'tmp_name\']);
if ($mime_type == \'image/jpeg\' || $mime_type == \'image/gif\' || $mime_type == \'image/png\') {
....