php test image exists code example Example: check image is available on server php Click to copyif (file_exists('http://www.mydomain.com/images/'.$filename)) { … }