1<?php
2//array_rand ( array $array [, int $num = 1 ] )
3$input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank");
4$rand_keys = array_rand($input, 2);
5echo $input[$rand_keys[0]] . "\n";
6echo $input[$rand_keys[1]] . "\n";
7?>
8
9
1$array = ["a", "b", "c"];
2$random = $array[ Rand(0, count($array)-1) ];
3
4echo $random; // a or b or c
1$colors=["red","blue","green","orange"];
2echo $colors[array_rand($colors)];//green (or any color randomly)