longWordBreak

Availability: >= 3.0

Type: Object Method

Description: If users post excessively long words this can break-apart the design of your site. This function will cut words that are over a certain length.

Syntax:

string $html wproUtilities::longWordBreak (string $html_code [, integer $length [, string $cut]]);

Parameters:

$html
The function returns the HTML code with long words cut.

$html_code
The code sent from the form post that you want to process.

$length
optional, words over this length will be cut, the default value is 40.

$cut
optional, long words will be cut using this value. The default is a space.

Example:

In the following example $code holds the code sent from the form post and words over 50 characters will be cut with a space:

$code wproUtilities::longWordBreak ($code50' ');