Re: touch()ing it....advise needed.
| From: | tedd | Date: | Sat, 13 May 2006 15:28:16 +0000 |
| Subject: | Re: touch()ing it....advise needed. | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-236112@lists.php.net to get a copy of this message | ||
At 5:48 AM -0700 5/13/06, Ryan A wrote:
Hey, Heres my setup, I have a directory full of files and I get a request with an array of filenames For this example: a.txt b.txt c.txt if the above files dont already exist I need to create them (I am using touch() instead of fopen()) My question is which would you recommend, doing a readdir() and getting all the existing filenames in an array then doing a loop to see which exists and create the others OR just taking the new filenames, doing a while/for loop with a files_exists() on each and then creating the files.... I am favouring the second approach as in the first approach there are a lot of files the array could be pretty big which would cause other problems, but I would rather be corrected now if my thinking is flawed. Your advise appreciated. Thanks! RyanRyan: Try this, it worked for me: http://www.weberdev.com/get_example-4341.html Just put the name of the file into the $stringSearch. hth's tedd -- -------------------------------------------------------------------------------- http://sperling.com