$nialiakhirpraktikum = $ntugasakhir+$ratarata; //from other process
if ($nialiakhirpraktikum>79) { $grade="A"; }
else if ($nialiakhirpraktikum<=79 AND $nialiakhirpraktikum>67) { $grade="B"; }
else if ($nialiakhirpraktikum<=67 AND $nialiakhirpraktikum>55) { $grade="C"; }
else if ($nialiakhirpraktikum<=55 AND $nialiakhirpraktikum>44) { $grade="D"; }
else { $grade="E"; }
$array = array($grade);
print_r(array_count_values($array));
私はこのような配列にいくつかの結果があります:
Array ( [B] => 1 )
Array ( [B] => 1 )
Array ( [C] => 1 )
Array ( [C] => 1 )
Array ( [B] => 1 )
Array ( [B] => 1 )
Array ( [B] => 1 )
Array ( [B] => 1 )
Array ( [B] => 1 )
Array ( [B] => 1 )
次のように結果を取得する方法:
score for B = 8
score for C = 2