I have image files in a directory which have downloaded from several resources.
If I have the name of an image, how can I check its existence using PHP?
is_file()
checks whether the file exists.
EDIT: btw, getImageSize() tells you a lot about the image, if it is valid, parseable by your server, how big it is, what type of image, etc. It is said to be slower than some of the more specialized functions, but when this returns true, you can be sure that the image will be fully usable.