Lets say I have a simple 1D array with 10-20 entries. Some will be duplicate, How would I find out which entry is used the most? like..
$code = Array("test" , "cat" , "test" , "this", "that", "then");
How would I show "test" as the most used entry?
You can get a count of the number of occurrences of each value by using array_count_values.
To get the most frequently occurring value, you can call max on the array and then access the (first) value with array_search.
If you wish to cater for multiple most-frequent values, then something like the following would work:
Use array_count_values