首页 > php函数 > PHP tmpfile() 函数实例教程

PHP tmpfile() 函数实例教程

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);
?>

 

输出来.Testing, testing.


文章网址:http://www.phprm.com/function/e9449acc3747182b249f25e97db61ed1.html

随意转载^^但请附上教程地址。

标签:none

发表留言