Answers for "php random not in 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

Browse Popular Code Answers by Language