String in fopen() path
| From: | Don Smith | Date: | Fri, 30 Jun 2000 00:17:12 +0000 |
| Subject: | String in fopen() path | ||
| Groups: | php.db | ||
| Request: | Send a blank email to php-db+get-762@lists.php.net to get a copy of this message | ||
Before I ask the qestion, I'd like to say that the people on this are the
best! Several times, readers here have come to my rescue. Many, many thanks.
I need to write data files with filenames ending in '.txt', but making each
unique with a random number before the '.txt'. No problem gettting the
random number with the rand() function, but
$newfile=fopen("/htdocs/orders/$worders, "a+");
doesn't work. $worders is a random number with '.txt' appended, so the above
would seem to read:
$newfile=fopen("/htdocs/orders/2873790.txt, "a+");
..but, of course, it doesn't work that way.
Could someone suggest how to assign a radnomly generated number as the name
of a text file being written to disk?
Thanks very much,
Don Smith