tempnam

string tempnam(string directory, string prefix) 

Generates a temporary filename.

Returns:

Temporary filename; FALSE on error

Description:

This function generates a temporary filename unique within the specified directory. This function does not create the file; it only generates a name for it.

If the specified directory doesn’t exist, PHP uses the system’s default directory for temporary files. This directory is determined by the underlying system’s C library tempnam() function and is specified by the environment variable TMPDIR on Linux and TMP on Windows. If the system’s C library doesn’t provide a tempnam() function, PHP uses an internal function to generate a temporary filename, which uses a directory specified by the environment ...

Get PHP Functions Essential Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.