0 Members and 1 Guest are viewing this topic.

AuthorTopic: Use PHP To Check Whether Remote URL, Email Or Image Link Exist  (Read 1752 times)

Offline aegkaluk

  • Administrator
  • Hero Member
  • *****
  • Posts: 1103
  • Total Like : 0
    • Email
« 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";
}