Here's a blanket example since you didn't provide more details. This should get you going though.
$right = 0;
$wrong = 0;
$results = array();
$submitted = array(1 => 'A', 2 => 'C', 3 => 'D', 4 => 'C', 5 => 'A');
$answers = array(1 => 'A',2 => 'D',3 => 'B',4 => 'C',5 => 'A');
$total = count($answers);
for ($i=1; $i<=$total; ++$i)
{
$right += $submitted[$i] == $answers[$i] ? 1 : 0;
}
$wrong = $total - $right;
print 'Right: ' . $right . '<br />';
print 'Wrong: ' . $wrong;