|
uniqidGenerate a unique ID Description
string uniqid(string
$prefix = "", bool $more_entropy = false )Gets a prefixed unique identifier based on the current time in microseconds. Caution
This function does not generate cryptographically secure values, and must not be used for cryptographic purposes, or purposes that require returned values to be unguessable. If cryptographically secure randomness is required, the Random\Randomizer may be used with the Random\Engine\Secure engine. For simple use cases, the random_int and random_bytes functions provide a convenient and secure API that is backed by the operating system’s CSPRNG. Warning
This function does not guarantee uniqueness of return
value. Since most systems adjust system clock by NTP or like,
system time is changed constantly. Therefore, it is possible that
this function does not return unique ID for the
process/thread. Use Parameters
Return ValuesReturns timestamp based unique identifier as a string. Warning
This function tries to create unique identifier, but it does not guarantee 100% uniqueness of return value. Examples
Example #1 uniqid Example
<?php Notes
See Also
|