class Highlighter (View source)

Methods

__construct(string $q)

No description

HtmlString
highlight(string $text)

Highlight matching words in the text with <mark> tags.

string
truncate(string $text, int $chars = 100)

Truncate text surrounding the first match.

Details

__construct(string $q)

No description

Parameters

string $q

HtmlString highlight(string $text)

Highlight matching words in the text with <mark> tags.

Parameters

string $text

Return Value

HtmlString

string truncate(string $text, int $chars = 100)

Truncate text surrounding the first match.

Parameters

string $text
int $chars

Return Value

string