- array_rand: documentation ( source)
- array_flip: documentation ( source)
- array_keys: documentation ( source)
- min: documentation ( source)
<?php
$a = [
0 => 2,
1 => 7,
2 => 5,
3 => 2,
4 => 2,
5 => 3
];
echo array_rand(array_flip(array_keys ($a, min($a))));