开发者

Check whether an image file exists in a directory or not using PHP

开发者 https://www.devze.com 2023-01-02 04:16 出处:网络
I have image files in a direct开发者_C百科ory 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 e

I have image files in a direct开发者_C百科ory 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.


file_exists()

0

精彩评论

暂无评论...
验证码 换一张
取 消