A more accurate method is use the HTTP_POST_FILES array created when the file is uploaded to check the file's mime-type. In Tanya's example you'd use:
if ($HTTP_POST_FILES["imgfile"]["type"] == "image/gif") {
echo "You can't upload GIF images to this server<br>\n";
}
I can change the file extension to .jpg and sneak the upload through on a system which just checks the file extension. It's much harder to change the mime-type and more people just won't be bothered.
-geoff