- array_count_values: documentation ( source)
- str_shuffle: documentation ( source)
- in_array: documentation ( source)
<?php
$a = array();
for($i=0; $i<=6000; $i++) {
$n = str_shuffle('0123456789');
$a[] = $n;
echo $n.'</br>';
if(in_array(2,array_count_values($a))) {
echo 'PERDU';
break 1;
}
}