salve ho scritto questo piccolo codice per generare frasi random casuali,
Codice PHP:
<?php
$array[] = $_POST['giocatore1'];
$array[] = $_POST['giocatore2'];
$array[] = $_POST['giocatore3'];
$array[] = $_POST['giocatore4'];
$frase = rand(0, count($array)-1);
$frase2 = rand(0, count($array)-1);
$f = file("./frasi.txt");
$c = count($f);
$n = rand(0, ($c-1));
echo $array[$frase];
echo" ";
echo $f[$n];
echo" a ";
echo $array[$frase2];
?>
ma vorrei fare in modo che le variabili frase e frase 2 non fossero mai identiche, anche se passate dallo stesso form GET
E possibile? grazie