Re: unique random id
| From: | Dustin Pate | Date: | Thu, 19 Jun 2003 09:11:04 +0000 |
| Subject: | Re: unique random id | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-152129@lists.php.net to get a copy of this message | ||
<?php
$sid = '';
mt_srand ((double) microtime() * 1000000);
$Puddle =
'ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
for($index=0; $index < $this->session_code_length - 1; $index++)
{
$sid .= substr($Puddle, (mt_rand()%(strlen($Puddle))), 1);
}
?>
That should work.
"Awlad Hussain" <php@sheridan-phoenix.com> wrote in message
news:004b01c3363f$5e745e30$0600a8c0@GATEWAY...
How do i generate a unique random number?
thanks
awlad