I'm working on a php application that uses a common name format for all images (image-$image_id.jpg), because of this it references broken images someway, is there a function that does something like this:
$image = "image-$image_id.jpg";
if(!$image) {
$image = "no_image.jpg";
}
I know this code is totally bogus but I hope you see what I'm trying to do. I have an image on the server no_image.jpg and I want a function to check if the image that $image is referencing is a valid file, if it isn't, to change it to reference a different file (no_file.jpg).
A better example might be something like this:
if(!fileexists("image-$image_id.jpg")) {
$image = "no_image.jpg";
}
Thanks,
Ben