PHP: Check (validate) if the Uploaded File is an Image

This script checks if the uploaded file (via a form) is actually an image. You can choose between 2 validators: one that will check if the file is actually an image and the other one which checks the extension of the uploaded file.