Easy Tutorial
❮ Func Zip Entry Close Func Mysqli Thread Safe ❯

PHP tempnam() Function



Definition and Usage

The tempnam() function creates a temporary file with a unique filename in the specified directory.

This function returns the new temporary filename, or FALSE on failure.

Syntax

Parameter Description
dir Required. Specifies the directory where the temporary file is to be created.
prefix Required. Specifies the beginning of the filename.

Tips and Notes

Note: If the specified directory does not exist, tempnam() will create a file in the system's temporary directory.

Tip: See also tmpfile().


Example

The above code will output:


❮ Func Zip Entry Close Func Mysqli Thread Safe ❯