我有以下多维数组:
Student Name Exam Result Exam Grade
David 79 1H
Brian 54 2H2
Lisa 55 2H2
Simone 58 2H2
Francis 78 1H
Shauna 53 2H2
Sean 40 Pass
Xavier 95 1H
Tom 60 2H1
Andy 66 2H2
我需要编写一个函数来计算每个特定成绩在考试中获得的次数。例如,实现了 3 个“1H”。有任何想法吗?
$exam = array ( "names" => array ( "David",
"Brian",
"Lisa",
"Simone",
"Francis",
"Shauna",
"Sean",
"Xavier",
"Tom",
"Andy"
),
"results" => array ( 79,
54,
55,
58,
78,
53,
40,
95,
60,
66
),
"grades" => array ( "1H",
"2H2",
"2H2",
"2H2",
"1H",
"2H2",
"Pass",
"1H",
"2H1",
"2H1"
),
);