Re: A uniqe ID for every item
| From: | Nikolajus Krauklis | Date: | Mon, 03 Sep 2001 10:36:51 +0000 |
| Subject: | Re: A uniqe ID for every item | ||
| References: | 1 | Groups: | php.windows |
| Request: | Send a blank email to php-windows+get-9174@lists.php.net to get a copy of this message | ||
Maybe try this one:
$id_length = 32;
$id = 0;
srand ((double) microtime() * 1000000);
$Puddle = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789";
for($index=0; $index < $id_length - 1; $index++){
$id .= substr($Puddle, (rand()%(strlen($Puddle))), 1);
}
Put it all to class function and thats all.