cutHTML

Availability: >= 3.0

Type: Object Method

Description: Cuts an HTML string to the desired character length and closes any tags left open at the cut point.

Syntax:

string $html wproUtilities::cutHTMLstring $htmlint $length [, string $cut] );

Parameters:

The function returns the HTML cut to the desired length, with $cut added to the end and all open tags closed.

$html
The html code to cut.

$length
The length to cut the HTML code to.  The length does not include any HTML tags, it should be the length of text to cut the HTML to.

$cut
An optional string to append to the end of the cut HTML code.

Example:

$snippet wproUtilities::cutHTML$html100'...' );

This function is useful for showing article summaries on a news or blog page.