The tempnam() function creates a temporary file with a unique file name in the specified directory.
This function returns the new temporary file name, or FALSE on failure.
tempnam(dir,prefix)
| parameter | describe |
|---|---|
| dir | Required. Specifies the directory where temporary files are created. |
| prefix | Required. Specifies the beginning of the file name. |
Note: If the specified directory does not exist, tempnam() will generate a file in the system's temporary directory.
Tip: See tmpfile().
<?phpecho tempnam("C:inetpubtestweb","TMP0");?>The above code will output:
C:inetpubtestwebTMP1.tmp