$azul = "#4285f4"; // AZUL
$verde = "#34a853"; // VERDE
$amarelo = "#fbbc05"; // AMARELO
$vermelho = "#ea4335"; // VERMELHO
$color = rand(1, 4);
I'm using $color
inside a loop but in this simplistic way that my code is, the value of the variable can be repeated type 3, 3, 1
.
How do you make a value of 3 loops
, 1, 2, 3
, 1, 3, 2
, 3, 2, 1
... <
while ( $destaques->have_posts() ) { $destaques->the_post();
if($color == 1) { $color = $azul; }
elseif ($color == 2) { $color = $verde; }
elseif ($color == 3) { $color = $amarelo; }
elseif ($color == 4) { $color = $vermelho; } ?>