Returns a handle to a temporary file.
This function creates a writable temporary file that will be automatically removed by PHP when it is closed or the script ends. If the call succeeds, a file handle will be returned. Otherwise, FALSE is returned.
<?php
$fh = tmpfile();
fputs($fh, "some temp data");
fseek($fh, 0);
print fgets($fh);
fclose($fh);
?> some temp data A temporary file is opened, and some data written to it and read back out.