PHP function: uniqid () 1. function prototype
String uniqid ([string prefix [, bool more_entropy])
You can define the prefix and length of a unique ID.
2. version compatibility
PHP 3, PHP 4, PHP 5
III. basic function usage and examples
1. generate a unique ID
2. use the md5 () function to generate a unique ID.
Output: dfbc5c8c6438de075da28b3c8a413fd0
3. multiple unique IDs are generated, because they are measured in microseconds.
Output:
4bfd0e375108b
4bfd0e3753981
4bfd0e3753983
According to the generated results, unique IDs are sorted.
Use the uniqid () function to generate a unique ID. This function can be used to generate both temporary IDs and permanent unique IDs (stored in the database). For more information, see The PHP Manual.
In addition, the unique value between different systems can be implemented on the two parameters of uniqid (). The first parameter is the prefix, and different servers can be specified on different servers;
The second parameter returns more entropy. if it is true, 23 characters are returned.
Reprinted from: http://www.helloweba.com/view-blog-107.html