Home | Scripts | Tutorials | Books | Hosting | Forums | Links|

Navigation:

Home
Source code
Tutorials
RSS feeds
Articles
Wordpress plugins
Blog
Books
Software
Downloads
Hosting
manuals
Script directory
Training
Our Links






 
 

SPONSORS



 
 

Check if an image exists

This script requires the gd library to be up and running properly , for it to work .

Basically what this does is display a message depending on whether an image exists or not . Remember and include the @ before the GetImageSize function or you will get a php error displayed as well as our message .

Code :

<?php
//check if image exists
if($img = @GetImageSize("ihcomputing1.gif"))
{
echo "image exists";
}
else
{
echo "image does not exist";
}
?>

Example :

 

image exists