What is uniqid() in php?
(PHP 4, PHP 5, PHP 7, PHP 8) Show uniqid — Generate a unique ID Descriptionuniqid(string 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 Parametersprefix 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 more_entropy If set to 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. ExamplesExample #1 uniqid() Example
Notes
keith at keithtyler dot com ¶ 12 years ago
Andrew Moore ¶ 12 years ago
sprintf('%08s-%04s-%04x-%04x-%12s',// 32 bits for "time_low" hackan at gmail dot com ¶ 5 years ago
John Haugeland from FullOf.BS ¶ 13 years ago
rommel at rommelsantor dot com ¶ 11 years ago
strlen($i_url)) nodkz at mail dot ru ¶ 14 years ago
=uuid(); // 0001-7f000001-478c8000-4801-47242987 DimeCadmium ¶ 3 years ago
redtraider at gmail dot com ¶ 10 years ago
Enrico Pallazzo ¶ 12 years ago
$n=0; $n < strlen($index); $n++) { Anonymous ¶ 11 years ago
wooshoofoo ¶ 15 years ago
php at dot dot dot metehanarslan dot com ¶ 6 years ago
struuid(false); //Return sample: F4518NTQTQ mailrinke at _cutthis_yahoo dot com ¶ 15 years ago
ken at smallboxsoftware ¶ 15 years ago
david at ramaboo dot com ¶ 13 years ago
sprintf('%08s-%04s-%04x-%04x-%012s', php at ryanmckeel dot com ¶ 12 years ago
ciantic at NOSPAM dot oksidi dot com ¶ 8 years ago
uniqid_base36() . "\n"; // eb98xzzhq7 mt at banita dot de ¶ 1 year ago
sean at seancolombo dot com ¶ 13 years ago
sprintf('%08s-%04s-%04x-%04x-%012s', tom ¶ 11 years ago
jensenv at cshs dot org ¶ 7 years ago
Anonymous ¶ 9 years ago
lance_rushing at hotmail dot com ¶ 15 years ago
mark at whytewaters dot com ¶ 14 years ago
Jason ¶ 15 years ago
How to generate random ID in PHP?A unique user ID can be created in PHP using the uniqid () function. This function has two parameters you can set. The first is the prefix, which is what will be appended to the beginning of each ID. The second is more_entropy.
How to get system unique ID in PHP?How to Get Unique ID in Machine in PHP. function UniqueMachineID($salt = "") {. if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {. $temp = sys_get_temp_dir().DIRECTORY_SEPARATOR." ... . if(!file_exists($temp) && ! ... . $output = shell_exec("diskpart /s ".$ ... . $lines = explode("\n",$output);. Is PHP timestamp unique?uniqid() in PHP generates a unique ID based on the current timestamp in microseconds.
|