tempnam

tempnam -- create unique file name

Description

string tempnam(string dir, string prefix);

Creates a unique temporary filename in the specified directory. If the directory does not exist, tempnam() may generate a filename in the system's temporary directory.

Returns the new temporary filename, or the null string on failure.

Example 1. tempnam() example

$tmpfname = tempnam( "/tmp", "FOO" );