My code randomizes an array index which consists 3 values for example.
$t1 = array("6","7","8");
$randomized = array_rand($t1, 3);
echo $t1[$randomized[0]];
only outputs the value 6.
$randomized = array_rand($t1, 2);
echo $t1[$randomized[0]];
only outputs the value 6 or 7.
However this works :
$randomized = array_rand($t1, 1);
echo $t1[$randomized];
this works and outputs 6,7 or 8
I don't get it and YES I did execute the function like 10 times to see if its not just coincidence.