Bir dizi
$my_array = array('a','b','c','d','e');
Ben iki FARKLI rasgele öğeleri almak istiyorum.
Aşağıdaki kodu:
for ($i=0; $i<2; $i++) {
$random = array_rand($my_array); # one random array element number
$get_it = $my_array[$random]; # get the letter from the array
echo $get_it;
}
it is possible to get two times the same letter. I need to prevent this. I want to get always two different array elements. Can somebody tell me how to do that? Thanks