A PHP port of the html_truncator rubygem