note 23270 added to function.uniqid
| From: | php-general at lists dot php dot net | Date: | Sat, 13 Jul 2002 13:52:26 +0000 |
| Subject: | note 23270 added to function.uniqid | ||
| Groups: | php.notes | ||
| Request: | Send a blank email to php-notes+get-33023@lists.php.net to get a copy of this message | ||
The power of your function is that it takes more than 1 milisecond so you have always an uniq id.
You can replace that whole function with this:
function uniq_id()
{
sleep(1);
$id = microtime();
}
and then you can use uniq_id() or md5(uniq_id())
--
http://www.php.net/manual/en/function.uniqid.php
http://master.php.net/manage/user-notes.php?action=edit+23270
http://master.php.net/manage/user-notes.php?action=delete+23270
http://master.php.net/manage/user-notes.php?action=reject+23270