choose a random word from an array php
$items = array(1, 2, 3, 4, 5);
echo $items[array_rand($items)];
choose a random word from an array php
$items = array(1, 2, 3, 4, 5);
echo $items[array_rand($items)];
php get random element from array
<?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";
?>
random array php
$array = ["a", "b", "c"];
$random = $array[ Rand(0, count($array)-1) ];
echo $random; // a or b or c
array random php
<?php
$indexedArray = array("red", "blue", "green", "black");
echo $indexedArray[array_rand($indexedArray)];
?>
Copyright © 2021 Codeinu
Forgot your account's password or having trouble logging into your Account? Don't worry, we'll help you to get back your account. Enter your email address and we'll send you a recovery link to reset your password. If you are experiencing problems resetting your password contact us