Comparing and highlighting phrases in text with php
<p>I have an array of words <code>$duplicate_words</code> and a string <code>$contents</code>. I want to search for the words in the string and highlight them when there is a match. </p>

<p>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?</p>
