PHP - check if uploaded file is image, how could I do this?

Oh C

New member
I'm working on a new project...

User's can upload images...but I want to check if the image is actually an image.

Could I do it like this:

$valid_image = false;
if($_FILE['userfile']['type'] == 'image/gif') $valid_image = true;
else $valid_image = false;

if($valid_image) doSomething();

Is that a good enough check, or should I add more?
 
Back
Top