In PHP, you can use the file_exists() function to determine whether a picture exists. This function can detect whether a file or directory exists. The syntax format is "file_exists(lujing)"; if the picture file exists, it returns true. , otherwise return false.
The operating environment of this tutorial: windows7 system, PHP7.1 version, DELL G3 computer
In PHP, you can use the file_exists() function To determine whether the image exists.
Output result:
Let’s take a brief look at the file_exists() function:
file_exists() function checks whether the file or directory is exist. Returns true if the specified file or directory exists, false otherwise.
Syntax:file_exists(path)
Parameter description is as follows:
path: required. Specifies the path to be checked.
Recommended study: "PHP Video Tutorial"
The above is the detailed content of How to determine whether the image exists in php. For more information, please follow other related articles on the PHP Chinese website!