Determining if a file exists
am 10.08.2007 21:24:27 von Bob Sanderson
I need to execute an IF statement based on whether or not a file exists in
a given folder. If the file is in the folder, do A, if it's not, do B. Is
there a PHP statement that will determine if the file exists?
Any help will be greatly appreciated.
Re: Determining if a file exists
am 10.08.2007 21:30:41 von Bob Sanderson
Bob Sanderson wrote in
news:Xns99889CBC480Bcentroidincearthlink@69.28.186.158:
> I need to execute an IF statement based on whether or not a file
> exists in a given folder. If the file is in the folder, do A, if it's
> not, do B. Is there a PHP statement that will determine if the file
> exists?
>
> Any help will be greatly appreciated.
Thanks anyway, but I found it.
if (file_exists($filename))
Re: Determining if a file exists
am 11.08.2007 02:44:04 von Carl Vondrick
Bob Sanderson wrote:
> if (file_exists($filename))
You may consider is_readable() instead. If the file exists but you cannot
read it, file_exists() will still return true. If the file does not exist
or you cannot read it, is_readable() returns false.