Answers for "get php array of random numbers"

PHP
5

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";
?>
Posted by: Guest on June-20-2020
7

php random number

// $min and $max are optional
rand($min,$max);
Posted by: Guest on April-14-2020

Code answers related to "get php array of random numbers"

Browse Popular Code Answers by Language