using tim's idea: get a uniqid, convert it to numbers and shift the
difference :)
- get a uniqid
- convert the chars to numbers using php.net/ord
- use the 8 first numbers


(would be an alternative to rand() for 8-digits)



On Tue, Mar 10, 2009 at 9:48 AM, Tim Gales <[email protected]> wrote:

> chad qian wrote:
>
>> Hi,
>> I need to generate random 8-digit numbers continuously.And no duplication
>> among all those numbers.In other word,every single 8-digit number must be
>> unique.How to do php programming?
>>
> Change your specification to 13 characters and use the function uniqid
>
> Uniqid is driven by the system clock -- so it's granularity is a
> microsecond.
>
>
>
>
>
>
> _______________________________________________
> New York PHP User Group Community Talk Mailing List
> http://lists.nyphp.org/mailman/listinfo/talk
>
> http://www.nyphp.org/show_participation.php
>
_______________________________________________
New York PHP User Group Community Talk Mailing List
http://lists.nyphp.org/mailman/listinfo/talk

http://www.nyphp.org/show_participation.php

Reply via email to