PHP Filesystem 函数
tmpfile() 函数以读写(w+)模式建立一个具有唯一文件名的临时文件。
文件会在关闭后(用 fclose())自动被删除,或当脚本结束后。
</>codetmpfile()
提示:参见 tempnam()。
</>code<?php$temp = tmpfile();fwrite($temp, "Testing, testing.");//倒回文件的开头rewind($temp);//从文件中读取 1kecho fread($temp,1024);//删除文件fclose($temp);?>
输出:
</>codeTesting, testing.
如对本文有疑问,请提交到交流论坛,广大热心网友会为你解答!! 点击进入论坛