Re: Test if picture exists then load.

From: Date: Thu, 10 Jan 2002 10:27:31 +0000
Subject: Re: Test if picture exists then load.
References: 1  Groups: php.general 
Request: Send a blank email to php-general+get-80005@lists.php.net to get a copy of this message
On Thursday 10 January 2002 18:19, Dean Householder wrote: > I'm not sure what function I need to use, but I want to test if a picture > exists in a directory and if it does to display it but if not display > another graphic that says 'No Graphic Available'. > > Would that be fopen()? or something else? I'm still new to PHP so any > feedback would be very appreciated. Use file_exists() to check whether a file exists. To check whether is is a valid image file you could use getimagesize(). hth -- Jason Wong -> Gremlins Associates -> www.gremlins.com.hk /* Military justice is to justice what military music is to music. -- Groucho Marx */

« previous php.general (#80005) next »