69pao国产精品视频-久久精品一区二区二三区-精品国产精品亚洲一本大道-99国产综合一区久久

PHP tmpfile() 函數(shù)

PHP tmpfile() 函數(shù)

PHP Filesystem 參考手冊 完整的 PHP Filesystem 參考手冊

定義和用法

tmpfile() 函數(shù)以讀寫(w+)模式創(chuàng)建一個具有唯一文件名的臨時文件。

語法

tmpfile()

提示和注釋

注釋:臨時文件會在文件關(guān)閉后(用 fclose())或當(dāng)腳本結(jié)束后自動被刪除。

提示:參見 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);
?>

上面的代碼將輸出:

Testing, testing.

PHP Filesystem 參考手冊 完整的 PHP Filesystem 參考手冊
相關(guān)文章