public function setHighlights(array $highlights) {
    uksort($highlights, [$this, 'compareLength']);
    $this->_highlights = [];
    $pattern = '';
    foreach ($highlights as $string => $className) {
      $key = strtolower($string);
      $this->_highlights[$key] = $className;
      $pattern .= '|'.preg_quote($key);
    }
    $this->_pattern = '(('.substr($pattern, 1).'))ui';
  }
public function setHighlights(array $highlights) {
    uksort($highlights, [$this, 'compareLength']);
    $this->_highlights = [];
    $pattern = '';
    foreach ($highlights as $string => $className) {
      $key = strtolower($string);
      $this->_highlights[$key] = $className;
      $pattern .= '|'.preg_quote($key);
    }
    $this->_pattern = '(('.substr($pattern, 1).'))ui';
  }
public function setHighlights ( array $ highlights ) { uksort ( $ highlights , [ $ this , 'compareLength' ] ) ; $ this -> _highlights = [ ] ; $ pattern = '' ; foreach ( $ highlights as $ string => $ className ) { $ key = strtolower ( $ string ) ; $ this -> _highlights [ $ key ] = $ className ; $ pattern .= '|' . preg_quote ( $ key ) ; } $ this -> _pattern = '((' . substr ( $ pattern , 1 ) . '))ui' ; }
Set string => class name mapping

@param array $highlights
Set string = > class name mapping