* Thus wrote jan ([EMAIL PROTECTED]):
> Hi there!
> 
> What's the best way to create uids (unique ids) even when runnig at
> exactly same time (microseconds)?
> 
> is this enough ???
> 
> $r = mt_rand();
> $uid = uniqid(getmypid() . $r);

If you're running a cluster of machines I would include information
on the machine that is generating the uid.

$uid = uniqid(getmypid() . $r . '_MACHINE_NAME_');

Curt
-- 
"I used to think I was indecisive, but now I'm not so sure."

-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to