check if there's a file

A

Anonymous

Guest
Hi guys...

is it possible to check if a specific file exists?

like this:

if(some_check_function("pictures/93827484.jpg"))
echo "<img src='".$thepicture."'>";
else
echo "<img src='pictures/nopic.jpg'>";
 
eh, nevermind...

if(file(pictures/93489348.jpg))

it really was that simple... ;) I love php...
 
i dont know if the file command does the same thing but, you could just use
Code:
if (file_exists("pictures/93489348.jpg"))
 
file_exists is a better option over file command as it is meant specifically to check if the file exists.
 
ah... thanks!
then I guess I don't have to use error_reporting(0); to get rid of the errors ;)

-s
 
Back
Top