tosicky Posted October 15, 2010 Share Posted October 15, 2010 Please i'm working on a project and i need to write a code that generates a unique random serial number.How can i go about it? Quote Link to comment https://forums.phpfreaks.com/topic/215905-code-for-generating-random-serial-number/ Share on other sites More sharing options...
ZachMEdwards Posted October 15, 2010 Share Posted October 15, 2010 What format do you want your serial number to be in? rand() Quote Link to comment https://forums.phpfreaks.com/topic/215905-code-for-generating-random-serial-number/#findComment-1122367 Share on other sites More sharing options...
turkman Posted October 15, 2010 Share Posted October 15, 2010 easyway $randomNumber = rand(1111111,9999999); random number between 1111111 and 99999999 its about a 50 million to 1 shot of the same number being generated twice. Quote Link to comment https://forums.phpfreaks.com/topic/215905-code-for-generating-random-serial-number/#findComment-1122450 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.