rand function for lottery program

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!


I've written a lottery programme in PHP that selects 10 winners a week  
from approximately 18,000 shares.

The problem I have is that of the ten winners one week the same share  
number was drawn the next week and an adjacent share number the  
following week (that just happened to be owned by the same member)
The program is now being looked at suspisciously.

The main core of the random draw simply puts all the current share  
numbers into an array ($currWinner), draws a random number using the  
rand function between 1 and the number of shares ($lottshares) and  
returns the share id number.

for the random element ofthe program I use:

$currWinner = rand(1,$lottShares);

is this random enough? or is it possible that it needs seeding (although  
I don't totally understand seeding?

Any help will be appreciated.


Site Timeline