THE TRUNCENATOR

author Barnaby Walters

 Methods

~ THE TRUNCENATOR ~

truncate(string $string, int $length, string $uri, int $urilen, bool $parens, string $ellipsis, $hastags) : string
Static

Takes a string (tweet-like note) and some config params, produces a truncated version to spec.

todo A lot of this functionality is not properly implemented

Parameters

$string

string

The string to be truncated

$length

int

The maximum length of the output

$uri

string

The canonical URI of the post, to be added to the end

$urilen

int

Treat any URLs as if they were this length

$parens

bool

If trucation is not required, surround the canon. link with parens (())

$ellipsis

string

The string to append in the case of truncation

$hastags

Returns

stringThe truncated string