Count specific array values
As I can't comment, the philonus's answer is the clearer and best for me, if you want to display zero you can do this, initializing the stats array:

$input = array(
    "report=D","report=D","report=D","report=I","report=I"
);

$stats = array(
    'U' =&gt; 0,
    'D' =&gt; 0,
    'I' =&gt; 0,
);
foreach($input as $value) {
    $types = explode('=', $value);
    $stats[$types[1]]++;
}

print_r($stats);