Hi Phil,

> I'm doing everything correct, although my random 
> numbers don't seem totally random.  

There are two reasons for this.

Firstly, you might not be seeding mt_srand() with a sensible seed - if you
always use 23 as your seed, you'll always get the same sequence of random
numbers. You're better off seeding it with the current time or something -
if you haven't already, have a look at the manual page at
http://php.net/mt_srand, there's an example there.

Secondly, random numbers generated by a computer aren't random, they're
what's known as "pseudo-random". To generate truly random numbers you need
something like a decaying radioactive material as your seed source -
http://www.fourmilab.ch/hotbits/ provides exactly this, so you could always
get your seeds via the web :-)

Cheers
Jon



-- 
PHP General Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to