- shuffle: documentation ( source)
- range: documentation ( source)
<?php
$arr = range(0, 100);
shuffle($arr);
$size = count($arr)-1;
for ($i = $size; $i>=0; $i--) {
for ($j = 0; $j<=($i-1); $j++)
if ($arr[$j]>$arr[$j+1]) {
$k = $arr[$j];
$arr[$j] = $arr[$j+1];
$arr[$j+1] = $k;
}
}
print $size;