protected function getSnippet($content, $startAt = '', $length = 25)
    {
        $startPos = 0;

        if ($startAt !== '') {
            $startPos = strpos($content, $startAt);
            if ($startPos !== false) {
                $startPos += \strlen($startAt);
            }
        }

        $snippet = substr($content, $startPos, $length);
        if ((\strlen($content) - $startPos) > $length) {
            $snippet .= '...';
        }

        return $snippet;
    }
protected function getSnippet($content, $startAt = '', $length = 25)
    {
        $startPos = 0;

        if ($startAt !== '') {
            $startPos = strpos($content, $startAt);
            if ($startPos !== false) {
                $startPos += \strlen($startAt);
            }
        }

        $snippet = substr($content, $startPos, $length);
        if ((\strlen($content) - $startPos) > $length) {
            $snippet .= '...';
        }

        return $snippet;
    }
protected function getSnippet ( $ content , $ startAt = '' , $ length = 25 ) { $ startPos = 0 ; if ( $ startAt !== '' ) { $ startPos = strpos ( $ content , $ startAt ) ; if ( $ startPos !== false ) { $ startPos += \ strlen ( $ startAt ) ; } } $ snippet = substr ( $ content , $ startPos , $ length ) ; if ( ( \ strlen ( $ content ) - $ startPos ) > $ length ) { $ snippet .= '...' ; } return $ snippet ; }
Get a snippet from a HTML token.

@param string $content The content of the HTML token.
@param string $startAt Partial string to use as a starting point for the snippet.
@param int    $length  The target length of the snippet to get. Defaults to 25.

@return string
Get a snippet from a HTML token .