Elija una palabra aleatoria de una matriz PHP
$items = array(1, 2, 3, 4, 5);
echo $items[array_rand($items)];
Jumping Boy
$items = array(1, 2, 3, 4, 5);
echo $items[array_rand($items)];
<?php
//array_rand ( array $array [, int $num = 1 ] )
$input = array("Neo", "Morpheus", "Trinity", "Cypher", "Tank");
$rand_keys = array_rand($input, 2);
echo $input[$rand_keys[0]] . "\n";
echo $input[$rand_keys[1]] . "\n";
?>
$pick = random_int(1, 3);
$array = array("A", "B", "C", "D", "E", "F");
$random_key = array_rand($array, $pick);
foreach($random_key as $key) {
echo $array[$key] . "<br />";
}