Create a temporary file with a unique name in the specified directory:
<?php
echo tempnam("C:\inetpub\testweb","TMP0");
?>
The output of the code above could be:
C:\inetpub\testweb\TMP1.tmp
The tempnam() function creates a temporary file with a unique name in the specified directory.
Note: If the specified directory does not exist, tempnam() may generate a file in the system's temporary directory.
Tip: See also the tmpfile() function.
tempnam(
dir,
prefix)
Parameter | Description |
---|---|
dir | Required. Specifies the directory of where to create the temp file |
prefix | Required. Specifies the start of the filename |
Return Value: | The new temporary filename, FALSE on failure |
---|---|
PHP Version: | 4.0+ |
PHP Changelog: |
截取页面反馈部分,让我们更快修复内容!也可以直接跳过填写反馈内容!