función de PHP tmpfile ()
Definición y Uso
tmpfile función () crea un archivo temporal con un nombre de archivo único en lectura-escritura (w +) de modo.
gramática
tmpfile()
Notas y sugerencias
Nota: Los archivos temporales después de que el archivo se cierra (usando fclose ()), o cuando el archivo de comandos elimina automáticamente.
Consejo: Ver tempnam ().
Ejemplos
<?php
$temp = tmpfile();
fwrite($temp, "Testing, testing.");
//Rewind to the start of file
rewind($temp);
//Read 1k from file
echo fread($temp,1024);
//This removes the file
fclose($temp);
?>
$temp = tmpfile();
fwrite($temp, "Testing, testing.");
//Rewind to the start of file
rewind($temp);
//Read 1k from file
echo fread($temp,1024);
//This removes the file
fclose($temp);
?>
El código anterior es la salida:
Testing, testing.
Completar Manual de Referencia del Sistema de Archivos PHP