Method Summary

Cleans up a String::insert() formatted string with given $options depending on the 'clean' key in
$options. The default method used is text but html is also available. The goal of this function
is to replace all whitespace and unneeded markup around placeholders that did not get replaced
by String::insert().

Extracts an excerpt from the text surrounding the phrase with a number of characters on each side
determined by radius.

Highlights a given phrase in a text. You can specify any expression in highlighter that
may include the \1 expression to include the $phrase found.

Replaces variable placeholders inside a $str with any given $data. Each key in the $data array
corresponds to a variable placeholder name in $str.
Example: String::insert(':name is :age years old.', array('name' => 'Bob', '65'));
Returns: Bob is 65 years old.

Unicode aware version of wordwrap.

Wraps text to a specific width, can optionally wrap at word breaks.

Method Detail

Cleans up a String::insert() formatted string with given $options depending on the 'clean' key in
$options. The default method used is text but html is also available. The goal of this function
is to replace all whitespace and unneeded markup around placeholders that did not get replaced
by String::insert().

Returns

Link

Replaces variable placeholders inside a $str with any given $data. Each key in the $data array
corresponds to a variable placeholder name in $str.
Example: String::insert(':name is :age years old.', array('name' => 'Bob', '65'));
Returns: Bob is 65 years old.

Available $options are:

before: The character or string in front of the name of the variable placeholder (Defaults to :)

after: The character or string after the name of the variable placeholder (Defaults to null)

escape: The character or string used to escape the before character / string (Defaults to \)