HOME HTML CSS JAVASCRIPT SQL PHP JQUERY XML ASP.NET MORE...
REFERENCES | EXAMPLES | FORUM | ABOUT

PHP tempnam() Function


PHP Filesystem Reference Complete PHP Filesystem Reference

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

tempnam(dir,prefix)

Parameter Description
dir Required. Specifies the directory of where to create the temp file
prefix Required. Specifies the start of the filename


Tips and Notes

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

Tip: See also tmpfile()


Example

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

The output of the code above could be:

C:\inetpub\testweb\TMP1.tmp


PHP Filesystem Reference Complete PHP Filesystem Reference

Your suggestion:

Close [X]

Thank You For Helping Us!

Your message has been sent to W3Schools.

Close [X]
Search w3schools.com:

WEB BUILDING

Download XML Editor FREE Website BUILDER Free HTML5 Templates

SHARE THIS PAGE