Random unique id : uniqid « Utility Function « PHP






Random unique id

 
<?
srand ((double) microtime() * 1000000);
$uniq_id = uniqid(rand());
print $uniq_id;
?>
  
  








Related examples in the same category

1.Another way to create a unique ID is to prepend the derived value with a string:
2.function uniqid() generates a 13-character unique identification number based on the current time.