开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜