fonction tmpfile () de PHP
Définition et utilisation
fonction tmpfile () crée un fichier temporaire avec un nom de fichier unique en lecture-écriture (w +) Mode.
grammaire
tmpfile()
Trucs et astuces
Remarque: Les fichiers temporaires après que le fichier est fermé (avec fclose ()), ou lorsque le script se termine automatiquement supprimé.
Astuce: Voir tempnam ().
Exemples
<?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);
?>
Le code ci-dessus va afficher:
Testing, testing.
Remplissez Manuel PHP Référence Filesystem