I was wondering if anyone knows what mt_srand does. I know the manual says it 'seeds' the mt_rand function (which I use), but I don't understand what it seeds it with or how it's supposed to be used.
Any help is appreciated and thanks in advance...
The pseudorandom-sequence generators provided by rand() and mt_rand() work by storing a static value and then each time you call them they use that previous value as a starting point to calculate the next number in a pseudrandom sequence. The whole point of "seeding" is to initialize the random-number-generator to an unpredictable value. Otherwise, the RNG starts with the same number each time and so you'd get the same pseudo-random sequence each time. This can actually be useful for testing purposes, but is generally not so for the real-world purpose you wanted the random number for in the first place. :-)