has anyone tried using the "tmpfile()" or "tempnam()" functions? I'm trying to generate a file on the fly that will be unlinked when it is no longer in use.
If you have used either of these functions what is the proper syntax to implement them?
Here's the code I have so far using standard fopen():
fopen($file_name, "w+");
if ($file=fopen("$file_name", "w+")){
fputs($file, "contents of file");
fpassthru($file);
}
the other issue is that I definitely need a unique filename for each instance of this script, I'm just not sure how "tmpfile()" does that... also, does tmpfile() unlink the file or fclose it?
Any help is greatly appreciated.