vendredi 5 juillet 2019

Random value in php using array_rand

I have two values: #FFF & #000

I want to echo randomly anyone, for that I tried:

$color = array('#FFF','#000');
$color = array_rand($color);
$color = $color[$color];
echo $color;

But it doesn't display anything.




Aucun commentaire:

Enregistrer un commentaire