I have part of some code, and need it to match the exact answer given with the one in the database. If, for example, the answer is Levi Strauss, and I type in Bob Strauss, it's giving it as correct, because the database holds Levi Strauss, Levi, and Strauss as possible answers. I think the problem lies here:
if($aquestion['sol1'] != "" && substr_count($saAns,$aquestion['sol1']) >= 1){
$check1 = 1;
}
if($aquestion['sol2'] != "" && substr_count($saAns,$aquestion['sol2']) >= 1){
$check2 = 1;
}
if($aquestion['sol3'] != "" && substr_count($saAns,$aquestion['sol3']) >= 1){
$check3 = 1;
}
if($aquestion['sol4'] != "" && substr_count($saAns,$aquestion['sol4']) >= 1){
$check4 = 1;
}
if($aquestion['sol5'] != "" && substr_count($saAns,$aquestion['sol5']) >= 1){
$check5 = 1;
}
Can anyone help?