美文网首页
Get file path from `tmpfile()` r

Get file path from `tmpfile()` r

作者: forks1990 | 来源:发表于2020-12-24 12:02 被阅读0次

PHP tmpfile() very handy to use, auto delete after request complete or fclose().

But many library not accept stream object, they only accept a physical file path, use fowling code to get path:

$f = tmpfile();
$p = stream_get_meta_data($f)['uri'];

相关文章

网友评论

      本文标题:Get file path from `tmpfile()` r

      本文链接:https://www.haomeiwen.com/subject/cscmnktx.html