Php count conditions inside loop

I have this array for example :

$array_test=array("gren","green","red","red","green","blue");

My idea is know inside loop number of elementos with the condition i want, the array for show it´s more complex and this is only example for understand i need, because try different ways with “count” and don´t show right this number in each case.

I try this :

foreach($array_test as $array_ts) {

if($array_ts=="green") { Count number of elements green /// }

if($array_ts=="red") { Count number of elements red /// }

if($array_ts=="blue") { Count number of elements blue /// }

}

Thank´s for the help, regards.