php对应js math.random

<?php

function random($min = 0, $max = 1)
{
    return $min + mt_rand()/mt_getrandmax()*($max-$min);
}
var_dump(random());
// 打印结果
float 0.79857454579257
?>
原文地址:https://www.cnblogs.com/haciont/p/6224953.html