我想在 PHP 中进行“个性”测试。我想用类似以下逻辑的东西来制作它:
If $answer_one == "a" --> $personality_a = $personality_a+1;
If $answer_one == "b" --> $personality_b = $personality_b+1;
If $answer_one == "c" --> $personality_c = $personality_c+1;
If $answer_one == "d" --> $personality_d = $personality_d+1;
See which $personality_* is the highest one and then send the response.
我怎样才能做出这样但可能更通用的东西foreach($_POST as $k => $v)
?