How about using array_count _values to get an array with everything counted for you?
More Related Contents:
- How do I count occurrence of duplicate items in array [duplicate]
- How to count non-empty entries in a PHP array?
- Count “truthy” values in a 2d array
- PHP – count specific array values
- Needle in a Haystack for Php [closed]
- Multiple inputs with same name through POST in php
- Can you store a function in a PHP array?
- Checking to see if one array’s elements are in another array in PHP
- Sort array of objects by one property
- PHP array multiple sort – by value then by key?
- Storing PHP arrays in cookies
- mysql_fetch_array, mysql_fetch_assoc, mysql_fetch_object
- Implode a column of values from a two dimensional array [duplicate]
- Checking if all the array items are empty PHP
- Get week number in month from date in PHP?
- Display array values in PHP
- How can I force PHP to use strings for array keys? [duplicate]
- Dynamic array keys
- Convert a String into an Array of Characters
- Create a comma-separated string from a single column of an array of objects
- Rotate array elements to the left (move first element to last and re-index)
- Grouping arrays in PHP
- Split array into a specific number of chunks
- Concatenate values of n arrays in php
- How to insert json array into mysql database
- Why do I get “Resource id #4” when I apply print_r() to an array in PHP? [duplicate]
- Change array key without changing order
- Moving array element to top in PHP
- phpexcel Allowed memory size of 134217728 bytes exhausted [duplicate]
- PHP, pass array through POST