Originally posted by Weedpacket
The Mersenne Twister RNG ([man]mt_rand[/man]) has the properties you're after: given a known seed, it will produce the same sequence on all implementations.
I saw the mersenne twister algorithm in the PHP.net function list and wondered if that would work - so no matter what the platform, installation, configuration or version, it would always produce the same 'random' sequence given a specific seed? I'll try it out and let you know. Thanks, you seem to be the only person who understood what I was aksing for 🙂
For the others - there is no real easy way of giving 'real' random numbers, only a number of algorithms that produce seemingly random numbers - the more complex the funcion, the longer the sequence is before it seems to begin to repeat. So if you seed a function with number X, you should always get sequence Y. It is useful in games design where you can use randomness to design levels, behaviour, events etc, but you need to be able to produce the same sequence of 'random' numbers every time, or players will see different level 1s, etc. My point was if user A installs the game and plays it, will user B get the same random level using a different version of PHP on a different server, etc.
Anyway, thanks for the responses.
R.