How to remove duplicate values from an array in PHP and count the occurrence of every element? I have this array
- foo
- bar
- foo
I want the result to be in array like this
value freq
---- ----
foo 2
bar 1
Thanks