note 109387 modified in function.tmpfile by danbrown

From: Date: Mon, 16 Jul 2012 15:34:44 +0000
Subject: note 109387 modified in function.tmpfile by danbrown
References: 1  Groups: php.notes 
Request: Send a blank email to php-notes+get-189184@lists.php.net to get a copy of this message
If you want to specify the extension name of tmp file:&#13;&#10;&#13;&#10;&#60;?php&#13;&#10;$tmp=array_search(&#39;uri&#39;, @array_flip(stream_get_meta_data($GLOBALS[mt_rand()]=tmpfile())));&#13;&#10;rename($tmp, $tmp.=&#39;.png&#39;);&#13;&#10;register_shutdown_function(create_function(&#39;&#39;, &#34;unlink(&#39;{$tmp}&#39;);&#34;));&#13;&#10;?&#62; --was-- If you want to specify the extension name of tmp file: <? $tmp=array_search('uri', @array_flip(stream_get_meta_data($GLOBALS[mt_rand()]=tmpfile()))); rename($tmp, $tmp.='.png'); register_shutdown_function(create_function('', "unlink('{$tmp}');")); ?> http://php.net/manual/en/function.tmpfile.php

« previous php.notes (#189184) next »