Hey all 🙂 I was wondering if there was a way to check whether an image exists or not.

So... say for example i had the link: www.foobar.com/blabla.gif, is there any way to check if that is a real image because i dont want any of these boxes showing with the red cross in (ie. when an image doesnt exist)

Many Thanks, BIOSTALL

    Will that check images from external sites as well?? The users are typing there own links in so the images could be from any site.

    Thanks, BIOSTALL

      hey

      file_exists() returns true also for directories.... try function is_file() too....

        No...I'd recommend checking out the CURL library for doing that...

        http://www.php.net/curl/

        There are actually quite a few ways to check on external sites but CURL is a rather elegant tool to use...

          Write a Reply...