Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
有没有办法在我的项目的服务器上创建一个临时文件。它应该永久保存我不需要的图片。
在此先感谢您的帮助
我想你正在寻找tmpfile()
tmpfile()
手册页中的代码:
<?php $temp = tmpfile(); fwrite($temp, "writing to tempfile"); fseek($temp, 0); echo fread($temp, 1024); fclose($temp); // this removes the file ?>
您需要tempnam或tmpfile - 您的选择。