Menu Samaritan's Purse

UNIQID

Generate a unique ID

SYNTAX

uniqid ( [ string $prefix = "" [, bool $more_entropy = FALSE ]] ) : string

PARAMETERS

prefix

Can be useful, for instance, if you generate identifiers simultaneously on several hosts that might happen to generate the identifier at the same microsecond.

With an empty prefix, the returned string will be 13 characters long. If more_entropy is TRUE, it will be 23 characters.

more_entropy

If set to TRUE, uniqid() will add additional entropy (using the combined linear congruential generator) at the end of the return value, which increases the likelihood that the result will be unique.

RETURN

Returns timestamp based unique identifier as a string.

Warning: This function tries to create a unique identifier, but it does not guarantee a 100% uniqueness of return value.

EXAMPLES

VOID

5f94411aee003

PREFIX

prefix5f94411af37ed

MORE_ENTROPY

5f94411b04dbc7.40366225

PHP