PHP função tmpfile ()
Definição e Uso
função tmpfile () cria um arquivo temporário com um nome de arquivo exclusivo na leitura e escrita (w +) modo.
gramática
tmpfile()
Dicas e Notas
Nota: Os arquivos temporários após o arquivo é fechado (usando fclose ()), ou quando o script termina automaticamente excluídos.
Dica: Veja tempnam ().
Exemplos
<?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);
?>
O código acima exibirá:
Testing, testing.
Manual Completo PHP Sistema de Arquivos de Referência