Uniqid
(PHP3, PHP4)
Uniqid---&http://www.aliyun.com/zixun/aggregation/37954.html ">nbsp; produce a unique ID
Syntax: int uniqid (String prefix [, Boolean LCG])
Description:
Uniqid () returns a unique identifier for the current time of one out of 10,000 seconds, and if you produce identifier on several hosts at the same time, it can happen to generate identifier on the same one out of 10,000 second, and then you can use parameter prefix, Parameter prefix can be up to 114 characters long.
If the LCG parameter is set to True,uniqid () the additional "combined LCG" will be added after the return value, which makes the result even more unique.
Empty prefix, the returned string will be 13 characters long and, if LCG is true, 23 characters long.
Note: parameter LCG only works in PHP4 and PHP3.0.13 and newer editions
If you need a unique identifier or tag, and you intend to publish the tag via receptacle (for example, session cookies), you can use this:
Example:
<?php
$token = MD5 (Uniqid ("")); No random portion
$better _token = MD5 (Uniqid (rand ())); Decoupled, difficult to guess
?>
This will produce a 32-character long identifier.