I need a PHP function that generates random number identical to javascript Math.random() with the same seed.
MDN about math.random():
The random number generator is seeded from the current time, as in Java.
As far I tried the PHP's rand() generates something like that:
srand( time() ); // I use time as seed, like javascript does
echo rand();
Output: 827382
And javascript seems to generate random numbers on it's own way:
Math.random(); Output: 0.802392144203139
I need PHP code that is equivalent for math.random(), not new javascript code. I can't change javascript.