Friday, August 19, 2011

PHP - Better and faster random values with mt_rand()

It's recommended to use mt_rand() instead of rand() function.

Powered by Mersenne Twister algorithm, mt_rand() is faster and produces better random values.

Ex: $rand = mt_rand(2, 200);

No comments: