- var_dump: documentation ( source)
- array_rand: documentation ( source)
- asort: documentation ( source)
- array_fill: documentation ( source)
- range: documentation ( source)
<?php
$values = range(0, 49);
$prob = array_fill(0, 50, 0);
for ($i = 0; $i < 10000; $i++) {
$rand = array_rand($values, 10);
foreach($rand as $key => $value) {
$prob[$values[$value]]++;
}
}
asort($prob);
var_dump($prob);