I have an array like so
Array
(
[5] => 0
[6] => 0
)
the key 5 and key 6 are user id\'s. the value 0 for both the keys are the num
What you need is min() for the lowest value in the array and array_rand() to get a random entry out of the array.
$yourArr = array(4, 4, 3, 5);
$lowestEntry = min($yourArr);
$duplicateEntries = array_keys($yourArr, $lowestEntry);
echo (count($duplicateEntries) > 1)?$yourArr[array_rand($duplicateEntries, 1)]:$lowestEntry;