shadiadiph Posted January 10, 2009 Share Posted January 10, 2009 is there a more logical way to generate a three digit random number than this? <? srand(time()); $random1 = (rand()%9); $random2 = (rand()%9); $random3 = (rand()%9); $mainnumber = "$random1 $random2 $random3"; ?> <? print $mainnumber; ?> Quote Link to comment Share on other sites More sharing options...
RussellReal Posted January 10, 2009 Share Posted January 10, 2009 rand(1,999); ? I suppose Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted January 10, 2009 Author Share Posted January 10, 2009 mm thanks but that didn't work Quote Link to comment Share on other sites More sharing options...
Andy-H Posted January 10, 2009 Share Posted January 10, 2009 rand(100,999); Quote Link to comment Share on other sites More sharing options...
shadiadiph Posted January 10, 2009 Author Share Posted January 10, 2009 seems to work thanks sorry i just thought my way was a bit long winded Quote Link to comment Share on other sites More sharing options...
Andy-H Posted January 10, 2009 Share Posted January 10, 2009 lol np Quote Link to comment Share on other sites More sharing options...
RussellReal Posted January 10, 2009 Share Posted January 10, 2009 lol damn andy -.- Quote Link to comment 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.