Menu Home

tmpfile

osbo.com | PHP | Functions | tmpfile

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

<?

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

?>
writing to tempfile

PHP