tmpfile() 函数以读写(w+)模式创建一个具有唯一文件名的临时文件。
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 ); ?> |
上面的代码将输出:
Testing, testing. |
在线实例
字符集 & 工具
最新更新
站点信息
关注我们