Re: open a file in a folder without knowing the filename
| From: | Paul Scott | Date: | Thu, 21 Jun 2007 10:51:47 +0000 |
| Subject: | Re: open a file in a folder without knowing the filename | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-257546@lists.php.net to get a copy of this message | ||
On Thu, 2007-06-21 at 01:49 +0100, Graham Shaw wrote:
> I'm probably missing something really obvious here but how would I go about
> opening a file or multiple files in a folder without knowing the filename
> ahead of time?
You can use the glob function http://www.php.net/glob to build
an array
of the files in a directory, according to a filter if needs be, and then
use a foreach to manipulate them
--Paul