Answers for "php get random value from associative array"

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

Code answers related to "php get random value from associative array"

Browse Popular Code Answers by Language