How does one generate a random float between 0 and 1 in PHP?
I\'m looking for the PHP\'s equivalent to Java\'s Math.random().
Math.random()
class SomeHelper { /** * Generate random float number. * * @param float|int $min * @param float|int $max * @return float */ public static function rand($min = 0, $max = 1) { return ($min + ($max - $min) * (mt_rand() / mt_getrandmax())); } }