<?php
function
random(
$min
= 0,
$max
= 1)
{
return
$min
+ mt_rand()/mt_getrandmax()*(
$max
-
$min
);
}
var_dump(random());
// 打印结果
float 0.79857454579257
?>
<?php
function
random(
$min
= 0,
$max
= 1)
{
return
$min
+ mt_rand()/mt_getrandmax()*(
$max
-
$min
);
}
var_dump(random());
// 打印结果
float 0.79857454579257
?>