How to use PHP to create a unique temporary file $ tmpfiletempnam (getcwd ()., TMP); create a unique temporary file tempnam -- create a file syntax with a unique File name: stringtempnam (stringdir, stringprefix) tempnam is used to create a unique temporary file using prefix in the specified directory.
$ Tmpfile = tempnam (getcwd (). "/", "TMP"); // create a unique temporary file
Tempnam -- create a file with a unique file name
Syntax: string tempnam (string dir, string prefix)
Tempnam is a unique temporary file prefixed with prefix (TMP (*) created under the specified directory (*). tmp), the suffix of the file name is tmp, the prefix passed here, the maximum length is 3, if more than 3, the following will be truncated. For example, if you write TEMP, only the TEM is used as the prefix.
In addition, the getcwd function obtains the current working directory (get current work dir ).
// Current directoryecho getcwd (). "\ n"; // echo/home/didouchdir ('CVS '); // current directoryecho getcwd (). "\ n"; // echo/home/didou/cvs
?