The PHP uniqid() function generates a unique ID based on the microtime (the current time in microseconds).
Syntax
uniqid(prefix, more_entropy)
Parameters
Parameter | Description |
---|---|
prefix | Specifies a prefix to the unique ID (useful if two scripts generate ids at exactly the same microsecond) |
more_entropy | Specifies more entropy at the end of the return value, making the result more unique; when set to TRUE, the return string will be 23 characters (default is FALSE, and the return string will be 13 characters long) |