How to check if there's an image in the folder using php?

Jona B

New member
I want to code an if else statement to check if there's an image in the folder.
EX. i want to check if apple.jpg is in the image folder or not

if apple.jpg exists, echo <img src...apple.jpg>
else echo <img src... na.jpg>

what statement do i use to check if there's the name of the image file in a certain folder?
 
Back
Top