jacko_162 Posted January 4, 2011 Share Posted January 4, 2011 As above, I have a lottery style site that picks a random number between 1-8 but my users complain for some reason that this is not enough. So i was told to look into using fopen and random.org to generate a random number. Anyone have experience of this and perhaps a code snippet for me to look at and possibly use? help will be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/223348-choosing-random-number-using-fopen-and-randomorg/ Share on other sites More sharing options...
QuickOldCar Posted January 4, 2011 Share Posted January 4, 2011 Well being just 1 to 8 I can see why. <?php $number = rand(1,5000)-1;//1 is minumum number, 5000 is the maximum echo $number; ?> Can even get crazy with this by running a for loop to create a random numbers array, then shuffle_array() and from that array pull a random result. Quote Link to comment https://forums.phpfreaks.com/topic/223348-choosing-random-number-using-fopen-and-randomorg/#findComment-1154563 Share on other sites More sharing options...
jacko_162 Posted January 4, 2011 Author Share Posted January 4, 2011 yes i use the PHP rand feature already, thats why i wanted to change this to pull from random.org or something. Quote Link to comment https://forums.phpfreaks.com/topic/223348-choosing-random-number-using-fopen-and-randomorg/#findComment-1154567 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.