Not that I'm into any of this PHP stuff, but this guy did a descent job of making a tag cloud generator that can read text documents, parse each term, find out the stems or roots of complex words, eliminate stop words and make a usable tag cloud. Check it out at:
http://chir.ag/phernalia/preztags/ (Analysis of Presidential Speeches going back to 1776)