<?php$str='<html><body><![CDATA[alert alert]]><h1> This is the title </h1><!--alertalert--><p> some description text here, <b>this</b> is a word. </p></body></html>';print_r(array_count_values(str_word_count(strip_tags(strtolower($str)),1)));?>