English | 简体中文 | 繁體中文 | Русский язык | Français | Español | Português | Deutsch | 日本語 | 한국어 | Italiano | بالعربية
The tempnam() function can create a temporary file with a unique filename in the specified directory and return the new temporary filename (with path), or return false on failure.
string tempnam ( string $dir, string $prefix )
This function can create a file with a unique filename and set the access permissions to 0 in the specified directory600. If the directory does not exist or is not writable, the tempnam() function may generate a file in the system's temporary directory and return the complete path (including its name).
<?php echo tempnam("C:\PhpProject", "TMP0"); ?>
Output Result
C:\PhpProject\TMPABFA.tmpPHP Filesystem Reference Manual