PHP创建随机tmp文件并获取其完整路径 [英] PHP create random tmp file and get its full path
本文介绍了PHP创建随机tmp文件并获取其完整路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
$ temp = tmpfile();
fwrite($ temp,写入tempfile);
我想得到 我需要做些什么来获取这些信息? 请参阅这个例子。 After I do: I'd like to get a full path to the What do I need to do to get that information? See this example. 这篇关于PHP创建随机tmp文件并获取其完整路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋! $ temp
文件
tmpfile
已创建。
解决方案
$ path = tempnam(sys_get_temp_dir(),'prefix');
$temp = tmpfile();
fwrite($temp, "writing to tempfile");
$temp
file that tmpfile
has created. 解决方案 $path = tempnam(sys_get_temp_dir(), 'prefix');
查看全文