You are here

public function Data::tagsCount in Translation Management Tool 8

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 132

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