Get file path from `tmpfile()` r

2020-12-24  本文已影响0人  forks1990

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'];
上一篇 下一篇

猜你喜欢

热点阅读