Re: detect if file exist
| From: | Ryan A | Date: | Sun, 21 May 2006 17:38:07 +0000 |
| Subject: | Re: detect if file exist | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236578@lists.php.net to get a copy of this message | ||
> On 5/21/06, Ryan A <genphp@yahoo.com> wrote:
> > Ummmm file_exists() ?
>
> file_exists doesn't help here since the filename of
> the file is not known. glob or the *dir functions do
> the trick.
>
> Rabin
>
Its all connected, had you searched the SEs first,
your would have found file_exists(), then if you read
that functions page at php.net you would have seen
readdir() which is another way of doing exactly what
you want..
eg:
readdir, if the directory is populated you can then
check the extention (eg: .com, php, xls or whatever)
All I am saying is, try to use the list as pretty much
your last resort..
------
- The faulty interface lies between the chair and the keyboard.
- Creativity is great, but plagiarism is faster!
- Smile, everyone loves a moron. :-)
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com