How to determine whether the image exists in php

青灯夜游
Release: 2023-03-12 16:06:01
Original
3164 people have browsed it

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.

How to determine whether the image exists in php

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.

Copy after login

Output result:

How to determine whether the image exists in php

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!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!