1 2 3 4 5 6 7 8 9 10
<?php $str = '<html> <body> <h1> This is the title </h1> <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))); ?>
1 2 3 4 5 6 7 8 9 10 11 12 13
Array ( [this] => 2 [is] => 2 [the] => 1 [title] => 1 [some] => 1 [description] => 1 [text] => 1 [here] => 1 [a] => 1 [word] => 1 )