Home What is the max number mt_rand() can generate in windows?
Reply: 0

What is the max number mt_rand() can generate in windows?

user677
1#
user677 Published in May 25, 2018, 11:10 am

Actually in my php application i want to assign every user a unique number code. For that i am using mt_rand(0,100000000). I want it to generate millions of number for say millions of different users without repeats and save it to database. Is it possible ? Or any other technique is recommended ? Also to make sure the number doesn't repeat I am checking if the number already exists in the db through php, if it does exist i reload the page to generate another number and save it to db orelse continue to save the number as it is. Is it the best pratice ?

I am new to this non repeating number generator in php so don't know the efficient method.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.36752 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO