I have an array of words $duplicate_words
and a string $contents
. I want to search for the words in the string and highlight them when there is a match.
I can highlight single duplicate words, but I don't want to highlight single words - I want to highlight only when two or more words match there. I've been trying to find a solution for over a week without success. Any ideas?