Re: file_exists and wildcard/regex
| From: | Maciek Sokolewicz | Date: | Tue, 09 Dec 2008 23:00:45 +0000 |
| Subject: | Re: file_exists and wildcard/regex | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-284394@lists.php.net to get a copy of this message | ||
Daniel Kolbo wrote:
What is the preferred method with php to test and see if a file [pattern] exists? For example, i only need to search in one directory, that may have any number of files named such as afile1.txt, afile2.txt, afile3.txt, .... And also, bfile1.txt, bfile2.txt, bfile3.txt, ... I want to see if any such file 'family' exists. That is, i want to see if there is any file named bfile[1-9][0-9]+.txt. I don't care which bfile number exists, i just want to know if any bfile exists. I hope this is clear enough, if not let me know. thanks, dKglob() http://www.php.net/glob