class CStringHelper


Located at : UKNOWVA_ROOT/components/com_community/helpers/string.php

Methods

static $text
isHTML($text)

Tests a bunch of text and see if it contains html tags.

static $text
nl2br($text)

Automatically converts new line to html break tag.

static 
isPlural($num)

No description

static 
isSingular($num)

No description

static 
escape($var, $function = 'htmlspecialchars')

No description

static 
clean($string) deprecated

No description

static 
replaceThumbnails($data)

No description

static 
replaceThumbnail($matches)

No description

static string
trim(string $value, int $length) deprecated

Truncate the given text

static 
truncate($value, $length, $wrapSuffix = '', $excludeImg = true)

Truncate the given text and append with '.

static 
getRandom($length = 11)

No description

Details

at line 18
static $text isHTML($text)

Tests a bunch of text and see if it contains html tags.

Parameters

$text String A text value.

Return Value

$text Boolean True if the text contains html tags and false otherwise.

at line 32
static $text nl2br($text)

Automatically converts new line to html break tag.

Parameters

$text String A text value.

Return Value

$text String A formatted data which contains html break tags.

at line 38
static isPlural($num)

Parameters

$num

at line 43
static isSingular($num)

Parameters

$num

at line 52
static escape($var, $function = 'htmlspecialchars')

Parameters

$var
$function

at line 64
static clean($string) deprecated

deprecated

Parameters

$string

at line 75
static replaceThumbnails($data)

Parameters

$data

at line 83
static replaceThumbnail($matches)

Parameters

$matches

at line 103
static string trim(string $value, int $length) deprecated

deprecated Use truncate instead. Trim has different meaning in PHP

Truncate the given text

Parameters

string $value
int $length

Return Value

string

at line 113
static truncate($value, $length, $wrapSuffix = '', $excludeImg = true)

Truncate the given text and append with '.

..' if necessary

Parameters

$value
$length
$wrapSuffix
$excludeImg

at line 127
static getRandom($length = 11)

Parameters

$length