|
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. Warning
This function does not create random nor unpredictable string. This function must not be used for security purposes. Use cryptographically secure random function/generator and cryptographically secure hash functions to create unpredictable secure ID. Parameters
Return ValuesReturns the unique identifier, as a string. Examples
Example #1 uniqid Example
<?php Changelog
NotesCaution
This function does not generate cryptographically secure tokens, in fact without being passed any additional parameters the return value is little different from microtime. If you need to generate cryptographically secure tokens use openssl_random_pseudo_bytes.
|