Using PHP to determine trends in a database of user texts
<p>I've read through a number of posts here about algorithms and generalized methods for calculating trends in texts, but I'm in need of a practical, simple example of how to do this using PHP.  </p>

<p><a href="http://stackoverflow.com/questions/859197/finding-trends-in-loads-of-text-data">One post that was more helpful than the rest</a> suggested normalizing each text and then breaking each into an array based on words (after filering out links, usernames, etc), building a large array of each word from each message and then using <a href="http://php.net/manual/en/function.array-count-values.php" rel="nofollow">array_count_values</a> to find which words were the most frequent.  This seems doable, but I don't know if it's the best way. It seems, for example, to favor single-word results rather than phrases ("Barack" and "Obama" rather than "Barack Obama").</p>

<p>Is there a better way to proceed than this? A practical example or pre-existing solution (a script or class) that I might use?  Thank you!</p>
