I have a problem when it comes to shuffling a sequence of numbers and show without repeating. For example, I have the sequence of 1 to 5, so I wanted to show only one of the 5 numbers, and after loading the page, show another of the 5 numbers so in succession until I enter the 5 digits of the pre-defined sequence, plus all without repeating any number ... Does anyone have an idea how to do this?
I tried to use this code here, it stores in session the numbers already shown to technically not show again, only it does not show the way I need it, that is, in a shuffled way, without repeating until the sequence is complete ...
$sorteio = rand(1,5);
if (isset($_SESSION["a$sorteio"])){
while (isset($_SESSION["a$sorteio"])){
$sorteio = rand(0,10);
}
}else{}
$_SESSION["a$sorteio"] = $sorteio;
echo $sorteio;