I need to know how to group and add array
, but I'm not sure how to do it.
$array = array("vermelho", "vermelho", "vermelho", "verde", "azul", "azul");
I wanted a return like this
3
1
2
That is, it will group and add up the amount of equal items.