Private archive copy · Unofficial site · Content copyright belongs to Runoob Tutorial and the original authors · View Original

PHP tmpfile() Function

PHP tmpfile() Function


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual


Definition and Usage

The tmpfile() function creates a temporary file with a unique name in read/write (w+) mode.

Syntax

tmpfile()


Tips and Notes

**Note:** The temporary file is automatically deleted when the file is closed (with fclose()) or when the script ends.

**Tip:** See tempnam().


Example

The code above will output:

Testing, testing.


PHP Filesystem Reference Manual Complete PHP Filesystem Reference Manual