I have a table in MySql with several different fields, one of them contains a description that could be a couple of paragraphs long.
I am trying to figure out a way to have php automatically go through these description fields and create a list of the top keywords used. I am looking for the top keywords for the entire table, not each post individually.
I know this is a bit of a resource heavy operation, and it wouldn’t be run very often anyways.
But I’d like to get a list like this:
some x 121
most x 110
frequent x 90
words x 50
So that I could see what the top used words are in the description field. Any idea at all where to start?
You can run you query,
loop through the records and append descriptions together into 1 big happy string.
Then, you can explode by ‘ ‘ into array
Get array of values using array_count_values()
Re-sort in descending order arsort()
Update
Sample code too: