Answers for "array_rand in php to return value"

PHP
3

php get random value from array

$colors=["red","blue","green","orange"];
echo $colors[array_rand($colors)];//green (or any color randomly)
Posted by: Guest on June-02-2021

Browse Popular Code Answers by Language