PHP tempnam() Function

Definition

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

Syntax

PHP tempnam() Function has the following syntax.

tempnam(dir,prefix)

Parameter

ParameterIs RequiredDescription
dirRequired.Directory of where to create the temp file
prefixRequired.Start of the filename

Return

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

Note

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

Example


<?php
echo tempnam("C:\test\testweb","TMP0");
?>




















Home »
  PHP Tutorial »
    Function reference »




PHP Array Functions
PHP Calendar Functions
PHP Class Functions
PHP Data Type Functions
PHP Date Functions
PHP File Functions
PHP Image Functions
PHP Math Functions
PHP MySQLi Functions
PHP SimpleXML Functions
PHP String Functions
PHP XML Functions
PHP Zip Functions