PHPのTMPFILE()関数
定義と使用法
TMPFILE()関数は、読み書き(ワット+)モードで一意のファイル名を持つ一時ファイルを作成します。
文法
tmpfile()
ヒントと注意事項
注:ファイルが閉じられた一時ファイルの後(fcloseを使用して、())、またはスクリプトが自動的に削除終了したとき。
ヒント:は、tempnam()を参照してください。
例
<?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);
?>
意志出力上のコード:
Testing, testing.
PHPファイルシステムリファレンスマニュアルを完了