Unstoppable Domains โ€” Get your daily AI drops report

PHP if statement help

NamecheapNamecheap
Watch

meblake

Established Member
Impact
0
Okay, I have an if statement which works but isn't what I want yet.

<?php if (catch_that_image()) : ?>
<img src="/wp-content/themes/base/thumb.php?src=<?php echo catch_that_image() ?>&h=100&w=100&zc=1">
<?php endif; ?>

What I need to for the if statement to check if the catch_that_image is a local copy or not. At the moment I am having the issue where I get blank boxes because the thumb.php script can't do hot linked images, which I don't want it to do either. Anyway, I have tried preg_match and some others, but that didn't work at all. Any ideas?

Thanks.
 
0
•••
The views expressed on this page by users and staff are their own, not those of NamePros.
GoDaddyGoDaddy
check to see if the file exists locally with file_exists

Code:
$theImage = catch_that_image();
if(file_exists("/path/to/image/{$theImage}") {
  . . . print the image .. . 
}
 
0
•••
Dynadot โ€” .com TransferDynadot โ€” .com Transfer
CatchedCatched
Escrow.com
Spaceship
Rexus Domain
CryptoExchange.com
Domain Recover
CatchDoms
DomDB
NameFit
  • The sidebar remains visible by scrolling at a speed relative to the pageโ€™s height.
Back