src/geshi.php
public function add_keyword($key, $word) {
        if (!is_array($this->language_data['KEYWORDS'][$key])) {
            $this->language_data['KEYWORDS'][$key] = array();
        }
        if (!in_array($word, $this->language_data['KEYWORDS'][$key])) {
            $this->language_data['KEYWORDS'][$key][] = $word;

            //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it
            if ($this->parse_cache_built) {
                $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1;
                $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/');
            }
        }
    }
public function add_keyword($key, $word) {
        if (!is_array($this->language_data['KEYWORDS'][$key])) {
            $this->language_data['KEYWORDS'][$key] = array();
        }
        if (!in_array($word, $this->language_data['KEYWORDS'][$key])) {
            $this->language_data['KEYWORDS'][$key][] = $word;

            //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it
            if ($this->parse_cache_built) {
                $subkey = count($this->language_data['CACHED_KEYWORD_LISTS'][$key]) - 1;
                $this->language_data['CACHED_KEYWORD_LISTS'][$key][$subkey] .= '|' . preg_quote($word, '/');
            }
        }
    }
public function add_keyword ( $ key , $ word ) { if ( ! is_array ( $ this -> language_data [ 'KEYWORDS' ] [ $ key ] ) ) { $ this -> language_data [ 'KEYWORDS' ] [ $ key ] = array ( ) ; } if ( ! in_array ( $ word , $ this -> language_data [ 'KEYWORDS' ] [ $ key ] ) ) { $ this -> language_data [ 'KEYWORDS' ] [ $ key ] [ ] = $ word ; //NEW in 1.0.8 don't recompile the whole optimized regexp, simply append it if ( $ this -> parse_cache_built ) { $ subkey = count ( $ this -> language_data [ 'CACHED_KEYWORD_LISTS' ] [ $ key ] ) - 1 ; $ this -> language_data [ 'CACHED_KEYWORD_LISTS' ] [ $ key ] [ $ subkey ] .= '|' . preg_quote ( $ word , '/' ) ; } } }
Adds a keyword to a keyword group for highlighting

@param int    $key  The key of the keyword group to add the keyword to
@param string $word The word to add to the keyword group
@since 1.0.0
Adds a keyword to a keyword group for highlighting