- mt_rand: documentation ( source)
- print_r: documentation ( source)
- rand: documentation ( source)
<?php
$r = array(0,0,0,0,0,0,0,0,0,0,0);
for ($i=0;$i<1000000;$i++) {
$n = rand(0,100000);
if ($n<=10) {
$r[$n]++;
}
}
print_r($r);
$r = array(0,0,0,0,0,0,0,0,0,0,0);
for ($i=0;$i<1000000;$i++) {
$n = mt_rand(0,100000);
if ($n<=10) {
$r[$n]++;
}
}
print_r($r);