Buenas tardes tengo una consulta con php, ahorita estoy recibiendo unas tutorias, pero uno de los proyectos que me dejaron es utilizar el comando shuffle y asi hacer un juego tipo tragamonedas donde aparecen cuatro imagenes, si salen cuatro iguales premio mayor, tres iguales segundo premio, etc. etc. la consulta es como puedo tomar ese valor y compararlo para que al salir las cuatro iguales me de el mensaje de premio mayor, lo que tengo son cuatro arreglos pero no puedo hacer la condicion para verificar el estardo, dejo el codigo aqui para ver si me podes ayudar.
<?php
$img = array ();
$img [1] = "A";
$img [2] = "B";
$img [3] = "C";
$img [4] = "D";
$img1 = array ();
$img1 [1] = "A";
$img1 [2] = "B";
$img1 [3] = "C";
$img1 [4] = "D";
$img2 = array ();
$img2 [1] = "A";
$img2 [2] = "B";
$img2 [3] = "C";
$img2 [4] = "D";
$img3 = array ();
$img3 [1] = "A";
$img3 [2] = "B";
$img3 [3] = "C";
$img3 [4] = "D";
shuffle ($img);
shuffle ($img1);
shuffle ($img2);
shuffle ($img3);
for ($i = 0; $i < 2; $i++){
echo $shuff = ($img[$i]." ");
}
for ($i1 = 0; $i1 < 2; $i1++){
echo $shuff1 = ($img1[$i1]." ");
}
/*for ($i2 = 0; $i2 < 1; $i2++){
echo $shuff2 = ($img2[$i2]." ");
}
for ($i3 = 0; $i3 < 1; $i3++){
echo $shuff3 = ($img3[$i3]." ");
}*/
$premio = 'Hola este es solo de prueba';
switch ($img[$i]) {
case ($shuff==$shuff1):
echo '<br>Premio de Consuelo '.$premio;
break;
case ($shuff==$shuff1 && $shuff==$shuff1):
echo '<br>Tercer Lugar '.$premio;
break;
case ($shuff==$shuff1 && $shuff==$shuff1 && $shuff==$shuff1 && $shuff==$shuff1):
echo '<br>Segundo Lugar '.$premio;
break;
case ($shuff==$shuff1 && $shuff==$shuff1 && $shuff==$shuff1 && $shuff==$shuff1):
echo '<br>Felicidades Gano el Premio Mayor '.$premio;
break;
default:
echo '<br>Intenta de Nuevo ';
}
?>
Spectrus: Cuando vayas a postear un código utiliza la étiqueta , queda mucho más estético y entendible.[/b]