Quantcast
Channel: Php Snippets Archives - BinaryTides
Viewing all articles
Browse latest Browse all 20

Get the path of tmpfile in php

$
0
0
tmpfile is a very handy function to create temporary files. It returns the file handle/resource. If the path of the file is needed, for use with file_put_contents for example then here is a quick trick to do that

$path = array_search('uri', @array_flip(stream_get_meta_data($GLOBALS=tmpfile())));
file_put_contents($path, 'hello');
echo file_get_contents($path);

Last Updated On : 14th March 2013...

Read full post here
Get the path of tmpfile in php


Viewing all articles
Browse latest Browse all 20

Trending Articles