PHP tempnam() Function

PHP tempnam Function


Define :

In this tutorial we have to learned about PHP tempnam() Function.The tempnam() Function inbuilt function in php.This function is used to creates a temporary file with a unique filename in the specified directory.Returns the new temporary filename (with path), or FALSE on failure.

Syntax

  tempnam(dirprefix)

Parameter 
Parameter Description
dir The directory where the temporary filename will be created
prefix The prefix of the generated temporary filename

Given below example shows the usage of PHP tempnam() Function :
 

Output :  C:\Users\OPH\AppData\Local\Temp\helCB1C.tmp