Calculates number of HTML tags, which a text consists of.
string $text:
int Returns count of tags of text.
public function tagsCount($text) {
// Regular expression for html tags.
$html_reg_exp = '/<.*?>/';
// Find all tags in the text.
$count = preg_match_all($html_reg_exp, $text, $matches);
return $count;
}