Posts: 252
Location: Auckland, New Zealand
|
"Math" is just the Javascript native object that contains some basic math functions.
The random() function produces a number between 0 and 1, so it could be any real number with only the limitations of how many decimals it could have.
The round() function is just to truncate the decimals after you have multiplied it so that the number is now a number between 0 and 10000000.
If you know PHP well enough, then you'd easily be able to write something that can imitate the similar effects, if it has to be similar to how it works under javascript.
Or you could just do:
PHP Code:
mt_rand(0,10000000);
Which I feel is equivalent enough.
Cheers,
MC
|