concrete/src/Utility/Service/Text.php
public function highlightSearch($value, $searchString)
    {
        if (strlen($value) < 1 || strlen($searchString) < 1) {
            return $value;
        }
        preg_match_all("/$searchString+/i", $value, $matches);
        if (is_array($matches[0]) && count($matches[0]) > 0) {
            return str_replace($matches[0][0], '<em class="ccm-highlight-search">' . $matches[0][0] . '</em>', $value);
        }

        return $value;
    }
public function highlightSearch($value, $searchString)
    {
        if (strlen($value) < 1 || strlen($searchString) < 1) {
            return $value;
        }
        preg_match_all("/$searchString+/i", $value, $matches);
        if (is_array($matches[0]) && count($matches[0]) > 0) {
            return str_replace($matches[0][0], '<em class="ccm-highlight-search">' . $matches[0][0] . '</em>', $value);
        }

        return $value;
    }
public function highlightSearch ( $ value , $ searchString ) { if ( strlen ( $ value ) < 1 || strlen ( $ searchString ) < 1 ) { return $ value ; } preg_match_all ( "/$searchString+/i" , $ value , $ matches ) ; if ( is_array ( $ matches [ 0 ] ) && count ( $ matches [ 0 ] ) > 0 ) { return str_replace ( $ matches [ 0 ] [ 0 ] , '<em class="ccm-highlight-search">' . $ matches [ 0 ] [ 0 ] . '</em>' , $ value ) ; } return $ value ; }
Highlights a string within a string with the class ccm-highlight-search.

@param string $value
@param string $searchString

@return string
Highlights a string within a string with the class ccm - highlight - search .