0 Members and 1 Guest are viewing this topic.

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

Offline aegkaluk

  • Administrator
  • Hero Member
  • *****
  • Posts: 1098
  • Total Like : 0
    • Email
« on: 12, 09, 2011, 09:25:28 »

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";