I need a php function which scans a mysql result and returns:
the list of similar txt used,
the nb of occurence for each similar text.
then the similar txt are shown in order of decresing nb of occurence
There are a couple of thousands of lines, should be done fast and efficiently.
example:
banana
playstation
tree
stuff
tree
playstation
football
tree
loan
banana
smart
smart
returns:
1. list of txt used:
banana
playstation
tree
stuff
football
loan
smart
2. nb of occurence for each:
2 banana
2 playstation
3 tree
2 stuff
1 football
1 loan
2 smart
3. in order:
3 tree
2 banana
2 playstation
2 stuff
2 smart
1 football
1 loan