I have 4 buttons which must have options (unique options, that is, they can not be repeated)
The options are in a bd of mysql, and everything works fine except that the options are repeated
The other functions that I have are so that the slogan matches the answers and that.
function rndResponse (){
GLOBAL $rnd;
$max = 3;
$rnd = rand(0, $max);
$opciones = array("Correct_Option", "Option_1", "Option_2", "Option_3");
$response = getResponse($opciones[$rnd]);
echo $response;
}
and then I call this function from an html using the value of the input, but, I repeat, there are times when the options are repeated. I have four buttons and I call the function in the value of each of them:
<input type="button" value="<?php rndResponse(); ?>">
input type="button" value="<?php rndResponse(); ?>">
<input type="button" value="<?php rndResponse(); ?>">
<input type="button" value="<?php rndResponse(); ?>">
Is there any way this does not happen?