我想运行小程序来确认安全问题:
$questions = array('dog legs','car legs','the best country in the world');
$answers = array(4,4,'USA');
$questionId = rand(0, (count($questions)-1));
进而
$ans = $_POST['answer'];
if($ans == $answers[$questionId]){echo 'Confirmed !';}
所以问题在于,并非每次我回答的答案都是正确的,因为在发送表单后,rand 函数会运行并更改问题!有什么解决办法吗?