note 110492 added to function.sys-get-temp-dir
| From: | EgbertvanderWal | Date: | Mon, 29 Oct 2012 07:45:35 +0000 |
| Subject: | note 110492 added to function.sys-get-temp-dir | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-191575@lists.php.net to get a copy of this message | ||
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.
----
Server IP: 83.137.20.135
Probable Submitter: 212.123.157.168
----
Manual Page -- http://www.php.net/manual/en/function.sys-get-temp-dir.php
Edit -- https://master.php.net/note/edit/110492
Del: integrated -- https://master.php.net/note/delete/110492/integrated
Del: useless -- https://master.php.net/note/delete/110492/useless
Del: bad code -- https://master.php.net/note/delete/110492/bad+code
Del: spam -- https://master.php.net/note/delete/110492/spam
Del: non-english -- https://master.php.net/note/delete/110492/non-english
Del: in docs -- https://master.php.net/note/delete/110492/in+docs
Del: other reasons-- https://master.php.net/note/delete/110492
Reject -- https://master.php.net/note/reject/110492
Search -- https://master.php.net/manage/user-notes.php