public function highlightSpecialWords($string)
    {
        // read specialword-table if not already read-in
        if ($this->_specialWordTable === null) {
            $this->_createSpecialWordTable();
        }

        // iterate over possible existing tags
        foreach ($this->_tags as $tag) {
            // get words for tags
            $words = $this->_specialWordTable[$tag];

            // iterate over words as word => description
            foreach ($words as $word => $description) {
                // replace it with template content if word found
                if (mb_strstr($string, $word)) {
                    // get template for tag
                    $tpl = $this->_templates[$tag];

                    // create HTML code
                    $html = str_replace('{$WORD}', $word, str_replace('{$DESC}', $description, $tpl));

                    // insert HTML into given string
                    $string = str_replace($word, $html, $string);
                }
            }
        }

        // return processed string result
        return $string;
    }
public function highlightSpecialWords($string)
    {
        // read specialword-table if not already read-in
        if ($this->_specialWordTable === null) {
            $this->_createSpecialWordTable();
        }

        // iterate over possible existing tags
        foreach ($this->_tags as $tag) {
            // get words for tags
            $words = $this->_specialWordTable[$tag];

            // iterate over words as word => description
            foreach ($words as $word => $description) {
                // replace it with template content if word found
                if (mb_strstr($string, $word)) {
                    // get template for tag
                    $tpl = $this->_templates[$tag];

                    // create HTML code
                    $html = str_replace('{$WORD}', $word, str_replace('{$DESC}', $description, $tpl));

                    // insert HTML into given string
                    $string = str_replace($word, $html, $string);
                }
            }
        }

        // return processed string result
        return $string;
    }
public function highlightSpecialWords ( $ string ) { // read specialword-table if not already read-in if ( $ this -> _specialWordTable === null ) { $ this -> _createSpecialWordTable ( ) ; } // iterate over possible existing tags foreach ( $ this -> _tags as $ tag ) { // get words for tags $ words = $ this -> _specialWordTable [ $ tag ] ; // iterate over words as word => description foreach ( $ words as $ word => $ description ) { // replace it with template content if word found if ( mb_strstr ( $ string , $ word ) ) { // get template for tag $ tpl = $ this -> _templates [ $ tag ] ; // create HTML code $ html = str_replace ( '{$WORD}' , $ word , str_replace ( '{$DESC}' , $ description , $ tpl ) ) ; // insert HTML into given string $ string = str_replace ( $ word , $ html , $ string ) ; } } } // return processed string result return $ string ; }
This method is intend to return a string with highlighted acronyms, definitions and abbreviations.

@param string $string The string to highlight words in

@author Benjamin Carl <opensource@clickalicious.de>

@return string The processed string
This method is intend to return a string with highlighted acronyms definitions and abbreviations .