title: PHP generate random phrases from text
body: <p>I am trying to build unique random phrases from text for detecting plagiarism. The idea is author will submit an article and then php will build phrases from text which will be used for plagiarism detection</p>
  
  <p>Consider following sentence:</p>
  
  <blockquote>
    <p>This is a very long and boring article and this article is plagiarized.</p>
  </blockquote>
  
  <p>Based upon the above text, system will determine how many phrases will be generated i.e. 20 words long article will have 3 phrases. Max generated phrase can be minimum two words long and maximum 3 words long. The returned output will be like this</p>
  
  <ul>
  <li>very long</li>
  <li>article is plagiarized</li>
  </ul>
  
  <p>I wrote following code</p>
  
  <pre><code>$words = str_word_count($text, 1);
  $total_phrases_required = count($words) /2;
  //build phrases
  </code></pre>
  
  <p>I need hint how to complete rest of the part.</p>