note 104478 added to function.uniqid
| From: | Anonymous at osu1 dot php dot net | Date: | Thu, 16 Jun 2011 23:08:27 +0000 |
| Subject: | note 104478 added to function.uniqid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-180633@lists.php.net to get a copy of this message | ||
Prefix can be useful, for instance, if you generate identifiers simultaneously on several hosts that
might happen to generate the identifier at the same microsecond.
So we can include the hostname / servername in the id.
<?php
echo uniqid(php_uname('n'), true);
// Output: darkstar4dfa8c27aea106.40781203
?>
----
Server IP: 80.67.10.228
Probable Submitter: 85.228.18.85
----
Manual Page -- http://www.php.net/manual/en/function.uniqid.php
Edit -- https://master.php.net/note/edit/104478
Del: integrated -- https://master.php.net/note/delete/104478/integrated
Del: useless -- https://master.php.net/note/delete/104478/useless
Del: bad code -- https://master.php.net/note/delete/104478/bad+code
Del: spam -- https://master.php.net/note/delete/104478/spam
Del: non-english -- https://master.php.net/note/delete/104478/non-english
Del: in docs -- https://master.php.net/note/delete/104478/in+docs
Del: other reasons-- https://master.php.net/note/delete/104478
Reject -- https://master.php.net/note/reject/104478
Search -- https://master.php.net/manage/user-notes.php