Phuket IT

Computer => Web Site => Topic started by: aegkaluk on 12, 09, 2011, 09:25:28

Title: Use PHP To Check Whether Remote URL, Email Or Image Link Exist
Post by: aegkaluk on 12, 09, 2011, 09:25:28
http://hungred.com/how-to/php-check-remote-email-url-image-link-exist/

Check Remote Image Link Exist
There are many ways to check whether a particular image link exist after the introduce of PHP 5, GetImageSize.  GetImageSize allows us to take in a remote link to retrieve the size of the image.  Hence, we can do a simple check such as the one shown below,

Code: [Select]
$external_link = 'http://www.example.com/example.jpg';
if (@GetImageSize($external_link)) {
echo "image exists";
} else {
echo "image does not exist";
}