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.

Link to comment
Share on other sites

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.

 

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.