php how to use getimagesize() to check image type on upload [duplicate]
Possible Duplicate: GetImageSize() not returning FALSE when it should i currently have a filter system as follows: // Check to see if the type of file uploaded is a valid image type function is_valid_type($file) { // This is an array that holds all the valid image MIME types $valid_types = array("image/jpg", "image/JPG", "image/jpeg", "image/bmp", "image/gif", "image/png"); if (in_array($file['type'], $valid_types)) return 1; return 0; } but i have been told that it is better to check the filetype myself, how would i use the getimagesize() to check the filetype in a similar way? getimagesize()