Brimbox Logo Brimbox Version 2.3.4 Released

custom_trim_string>>

Method to truncate, trim, and purge control characters from a string.

Class: bb_main, called as $main

File: bb_main.php (php)

Declaration:

function custom_trim_string($str, $length, $eol = true, $quotes = false)

Usage:

$string = $main->custom_trim_string($str, $length, $eol, $quotes);

Returns: string trimmed to specific length with control characters purged, optional EOL characters purged also.

Parameter: $str (string)
String to be checked and modified.

Parameter: $length (integer)
In characters, the maximum length of string returned.

Parameter: $eol (optional boolean)
If true, will also purge new line and returns.

Parameter: $quotes (optional boolean)
If true, will also purge double quotes, typically used in column names, list names and other meta data.

Updated: 2016-07-17