& Quot; $ qc_q1 $ _ POST [& #39; q1 & #39;]; $ qc_q2 $ _ POST [& #39; q2 & #39;]; $ qc_q3 $ _ POST [& #39; q3 & #39;]; $ qc_q4 $ _ POST [& #39; q4 & #39;]; $ qc_q5 $ _ POST [& #39; q5 & #39;]; $ qc_q6 $ _ POST [& #39; q6 & #39;]; $ qc_q7 $ _ POST [& #39; q7 & #39;]; $ qc_q8 $ _ POST [& #39; q8 & #39;]; $ qc_q9 $ _ POST return value php function
$qc_q1=$_POST['q1'];$qc_q2=$_POST['q2'];$qc_q3=$_POST['q3'];$qc_q4=$_POST['q4'];$qc_q5=$_POST['q5'];$qc_q6=$_POST['q6'];$qc_q7=$_POST['q7'];$qc_q8=$_POST['q8'];$qc_q9=$_POST['q9'];$qc_q10=$_POST['q10'];$qc_Choice = array($qc_q1,$qc_q2,$qc_q3,$qc_q4,$qc_q5,$qc_q6,$qc_q7,$qc_q8,$qc_q9,$qc_q10);$qc_Answer = array('a','d','d','b','b','c','d','d','c','c');$qc_total = qcFunction($qc_Choice,$qc_Answer);function qcFunction($qc_Choice,$qc_Answer){ $total=0; for($i=0;$i<10;$i++) { if($qc_Choice[i]==$qc_Answer[i]) { $total = $total + 10; }else { $total = $total + 0; } } return $total;}