5
$azul = "#4285f4"; // AZUL
$verde = "#34a853"; // VERDE
$amarelo = "#fbbc05"; // AMARELO
$vermelho = "#ea4335"; // VERMELHO
$color = rand(1, 4);
I’m using $color
within a loop but in this simple way that is my code, the value of the variable cited can be repeated like 3, 3, 1
.
How to make in a space of 3 loops
, the value is not repeated by forming sequences of the type 1, 2, 3
, 1, 3, 2
, 3, 2, 1
, 3, 1, 2
etc. ...
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; } ?>
I have a serious problem learning
arrays
@rray ... Don’t give private lessons by Skype, Teamviewer or something? Perfect solution.– Marcos Vinicius
@Marcosvinicius, haha can talk about it if you are interested.
– rray