I have a site where users can put in a description about themselves.
Most users write something appropriate but some just copy/paste the same text a number of times (to
I think you are on the right track breaking down the string and looking at repeated words.
Here is some code though which does not use a PCRE and leverages PHP native string functions (str_word_count and array_count_values):
int(1)
["a"]=>
int(6)
["and"]=>
int(6)
["peace"]=>
int(6)
["love"]=>
int(5)
}
*/
Some tweaks might be to: