Jump to content

Choosing random number using fopen and random.org


jacko_162

Recommended Posts

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.

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.

 

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.