pro19CEARGYHYDAY
New Member
I have this php that scores a test based on hourly answers:\[code\] $score_a = 0; foreach(array(4,5,10) as $a){ if ($a >= 2 && $a <= 4) { $score_a += 1; } else if ($a > 4 && $a <= 8) { $score_a += 3; } else if ($a > 8) { $score_a += 0; } };\[/code\]I need the final "else if" to score a bit differently. Instead of adding .5 once if the value is >8, I need it to add .5 for each whole number above 8.So this score needs to be 5 and not 4.5.