public function Data::tagsCount

Calculates number of HTML tags, which a text consists of.

Parameters

string $text:

Return value

int Returns count of tags of text.

File

src/Data.php, line 134

Class

Data
All data-related functions.

Namespace

Drupal\tmgmt

Code

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;
}