Jesus · Bible · HTML · CSS · JS · PHP · SVG · Applications

tmpfile

Description

The tmpfile of Filesystem for PHP creates a temporary file.

Syntax

tmpfile ( void ) : resource

Return

Returns a file handle, similar to the one returned by fopen(), for the new file or FALSE on failure.

Examples

1

<?

$temp = tmpfile();
fwrite($temp, "writing to tempfile");
fseek($temp, 0);
echo fread($temp, 1024);
fclose($temp); // this removes the file

?>
writing to tempfile
HomeMenu