note 110492 deleted from function.sys-get-temp-dir by danbrown
| From: | danbrown@php.net | Date: | Thu, 06 Dec 2012 14:26:01 +0000 |
| Subject: | note 110492 deleted from function.sys-get-temp-dir by danbrown | ||
| References: | 1 | Groups: | php.notes |
| Request: | Send a blank email to php-notes+get-192334@lists.php.net to get a copy of this message | ||
Note Submitter: Egbert van der Wal
----
I don't know why the posts here are all going through much trouble to find a
'non-existing' directory, if you want a file in the system temporary directory, you can
just pass an empty string as $dir. A directory with no name also cannot exist, so it will always
work.
So just:
<?php
$tmpfilename = tempnam("", "");
?>
will do the trick nicely.