php - How do I count occurences of items in an array

Posted by Steven on Stack Overflow See other posts from Stack Overflow or by Steven
Published on 2010-04-27T11:06:52Z Indexed on 2010/04/27 11:13 UTC
Read the original article Hit count: 154

Filed under:
|

take this array:

Array ( [#twitterwhites] => 0 [#lufc] => 0 [#FOOTBALL] => 0 [#Liverpool] => 0 [#liverpool] => 0 [#ESPN] => 0 [#LUFC] => 0 [#cafc] => 0 [#cafc] => 0 [#ocra] => 0 [#nra] => 0 [#2nd] => 0 [#secondamendment] => 0 [#SCR] => 0 [#TC500] => 0 [#cpfc] => 0 [#MOT] => 0 ) 

I want to return a result like this:

#liverpool = 2

#cafc = 2

#LUFC = 1  

ETC ETC

How do I do it?

© Stack Overflow or respective owner

Related posts about php

Related posts about arrays