RE: [PHP] create textfile if not existing?
| From: | Miguel Cruz | Date: | Mon, 29 Apr 2002 21:53:23 +0000 |
| Subject: | RE: [PHP] create textfile if not existing? | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-95281@lists.php.net to get a copy of this message | ||
On Mon, 29 Apr 2002, SHEETS,JASON (Non-HP-Boise,ex1) wrote:
> // get new filename until the filename does not exist
> while (is_file($filename)) {
> $filename .= $startnum;
> }
This will give you file names like file1, file11, file111, etc.
Might want to do this instead:
while (is_file("{$filename}{$startnum}.txt")
$startnum++;
miguel