Re: Testing existence of file in same directory as currentscript
| From: | Robert Vetter | Date: | Fri, 10 Nov 2000 09:30:55 +0000 |
| Subject: | Re: Testing existence of file in same directory as currentscript | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-24640@lists.php.net to get a copy of this message | ||
Rasmus Lerdorf wrote:
>
> file_exists('filename')
>
> On Thu, 9 Nov 2000, Stewart Macdonald wrote:
>
> > Hi all,
> >
> > Long time listener, first time poster.
> >
> > I'm trying to see if a file exists in the same directory as the
> > currently-running script. I'm sure this is a really easy one, but, so far,
> > nothing I have tried so far has worked, so far....
Page 253 of the PHP manual:
int file_exists (string filename)
Returns true if the file specified by filenameexists; false otherwise.
file_exists() will not work on remote files; the file to be examined
must be accessible via the servers
filesystem.
The results of this function are cached. See clearstatcache() for more
details.
Robert