$a=E;$b=D;$c=E;$d=A;
So I want to count how many 'E' or 'D' or 'A'?
Is this possible to perform this coding?
Help me.
Use array_count_values function
$a='E';
$b='D';
$c='E';
$d='A';
$values = array($a, $b, $c, $d);
$vals = array_count_values($values);
print_r($vals); // Array ( [E] => 2 [D] => 1 [A] => 1 )
array_count_values($values) is an array, so you can make a loop with foreach and get the keys and values for each element.