我很難比較用戶輸入的$ _POST和一組數組值。如何將POST響應與數組值進行比較?
我已經設置下列變量...
$response = $_POST['answer'];
...和選定的一範圍的可能正確答案,並將它們存儲在一個陣列...
$solutions = array('answer1','answer2','answer3');
I」已經試過檢查/這樣比較......
if (value($response) !== ($solutions)
{$error['result'] = "Wrong answer.";}
我知道這是行if (value($response) !== ($solutions)
。