TeamSpeak 3 PHP Framework
Modern use-at-will framework that provides individual components to manage TeamSpeak 3 Server instances
|
Helper class for string handling. More...
Inherits ArrayAccess, Iterator, and Countable.
Public Member Functions | |
__construct ($string) | |
The TeamSpeak3_Helper_String constructor. More... | |
__call ($function, $args) | |
Magical function that allows you to call PHP's built-in string functions on the TeamSpeak3_Helper_String object. More... | |
__toString () | |
Returns the character as a standard string. More... | |
append ($part) | |
Appends $part to the string. More... | |
arg (array $args, $char="%") | |
This function replaces indexed or associative signs with given values. More... | |
contains ($pattern, $regexp=FALSE) | |
Returns true if the string contains $pattern. More... | |
count () | |
current () | |
endsWith ($pattern) | |
Returns true if the string ends with $pattern. More... | |
escape () | |
Escapes a string using the TeamSpeak 3 escape patterns. More... | |
filterAlnum () | |
Removes any non alphanumeric characters from the string. More... | |
filterAlpha () | |
Removes any non alphabetic characters from the string. More... | |
filterDigits () | |
Removes any non numeric characters from the string. More... | |
findFirst ($needle) | |
Returns the position of the first occurrence of a char in a string. More... | |
findLast ($needle) | |
Returns the position of the last occurrence of a char in a string. More... | |
isInt () | |
Returns TRUE if the string is a numeric value. More... | |
isUtf8 () | |
Returns TRUE if the string is UTF-8 encoded. More... | |
key () | |
next () | |
offsetExists ($offset) | |
offsetGet ($offset) | |
offsetSet ($offset, $value) | |
offsetUnset ($offset) | |
prepend ($part) | |
Prepends $part to the string. More... | |
replace ($search, $replace, $caseSensitivity=TRUE) | |
Replaces every occurrence of the string $search with the string $replace. More... | |
resize ($size, $char="\) | |
Sets the size of the string to $size characters. More... | |
rewind () | |
section ($separator, $first=0, $last=0) | |
Returns a section of the string. More... | |
spaceToPercent () | |
Replaces space characters with percent encoded strings. More... | |
split ($separator, $limit=0) | |
Splits the string into substrings wherever $separator occurs. More... | |
startsWith ($pattern) | |
Returns true if the string starts with $pattern. More... | |
substr ($start, $length=null) | |
Returns part of a string. More... | |
toBase64 () | |
Encodes the string with MIME base64 and returns the result. More... | |
toCrc32 () | |
Calculates and returns the crc32 polynomial of the string. More... | |
toHex () | |
Returns the hexadecimal value of the string. More... | |
toInt () | |
Returns the integer value of the string. More... | |
toLower () | |
Returns the lowercased string. More... | |
toMd5 () | |
Calculates and returns the md5 checksum of the string. More... | |
toSha1 () | |
Calculates and returns the sha1 checksum of the string. More... | |
toString () | |
Returns the string as a standard string. More... | |
toUpper () | |
Returns the uppercased string. More... | |
toUtf8 () | |
Converts the string to UTF-8. More... | |
transliterate () | |
Returns the string transliterated from UTF-8 to Latin. More... | |
trim () | |
Strips whitespaces (or other characters) from the beginning and end of the string. More... | |
unescape () | |
Unescapes a string using the TeamSpeak 3 escape patterns. More... | |
uriSafe ($spacer="-") | |
Processes the string and replaces all accented UTF-8 characters by unaccented ASCII-7 "equivalents", whitespaces are replaced by a pre-defined spacer and the string is lowercase. More... | |
valid () | |
Static Public Member Functions | |
static | factory ($string) |
Returns a TeamSpeak3_Helper_String object for thegiven string. More... | |
static | fromBase64 ($base64) |
Decodes the string with MIME base64 and returns the result as an TeamSpeak3_Helper_String. More... | |
static | fromHex ($hex) |
Returns the TeamSpeak3_Helper_String based on a given hex value. More... | |
Protected Attributes | |
$position = 0 | |
Helper class for string handling.
__construct | ( | $string | ) |
__call | ( | $function, | |
$args | |||
) |
Magical function that allows you to call PHP's built-in string functions on the TeamSpeak3_Helper_String object.
string | $function | |
array | $args |
TeamSpeak3_Helper_Exception |
__toString | ( | ) |
append | ( | $part | ) |
arg | ( | array | $args, |
$char = "%" |
|||
) |
This function replaces indexed or associative signs with given values.
array | $args | |
string | $char |
contains | ( | $pattern, | |
$regexp = FALSE |
|||
) |
Returns true if the string contains $pattern.
string | $pattern | |
boolean | $regexp |
endsWith | ( | $pattern | ) |
Returns true if the string ends with $pattern.
string | $pattern |
escape | ( | ) |
Escapes a string using the TeamSpeak 3 escape patterns.
|
static |
Returns a TeamSpeak3_Helper_String object for thegiven string.
string | $string |
filterAlnum | ( | ) |
Removes any non alphanumeric characters from the string.
filterAlpha | ( | ) |
Removes any non alphabetic characters from the string.
filterDigits | ( | ) |
Removes any non numeric characters from the string.
findFirst | ( | $needle | ) |
findLast | ( | $needle | ) |
|
static |
Decodes the string with MIME base64 and returns the result as an TeamSpeak3_Helper_String.
string | $base64 |
|
static |
Returns the TeamSpeak3_Helper_String based on a given hex value.
string | $hex |
TeamSpeak3_Helper_Exception |
isInt | ( | ) |
isUtf8 | ( | ) |
Returns TRUE if the string is UTF-8 encoded.
This method searches for non-ascii multibyte sequences in the UTF-8 range.
prepend | ( | $part | ) |
replace | ( | $search, | |
$replace, | |||
$caseSensitivity = TRUE |
|||
) |
Replaces every occurrence of the string $search with the string $replace.
string | $search | |
string | $replace | |
boolean | $caseSensitivity |
resize | ( | $size, | |
$char = "\0" |
|||
) |
Sets the size of the string to $size characters.
integer | $size | |
string | $char |
section | ( | $separator, | |
$first = 0 , |
|||
$last = 0 |
|||
) |
Returns a section of the string.
string | $separator | |
integer | $first | |
integer | $last |
spaceToPercent | ( | ) |
split | ( | $separator, | |
$limit = 0 |
|||
) |
Splits the string into substrings wherever $separator occurs.
string | $separator | |
integer | $limit |
startsWith | ( | $pattern | ) |
Returns true if the string starts with $pattern.
string | $pattern |
substr | ( | $start, | |
$length = null |
|||
) |
Returns part of a string.
integer | $start | |
integer | $length |
toBase64 | ( | ) |
toCrc32 | ( | ) |
toHex | ( | ) |
toInt | ( | ) |
toLower | ( | ) |
Returns the lowercased string.
toMd5 | ( | ) |
toSha1 | ( | ) |
toString | ( | ) |
toUpper | ( | ) |
Returns the uppercased string.
toUtf8 | ( | ) |
Converts the string to UTF-8.
transliterate | ( | ) |
Returns the string transliterated from UTF-8 to Latin.
trim | ( | ) |
Strips whitespaces (or other characters) from the beginning and end of the string.
unescape | ( | ) |
Unescapes a string using the TeamSpeak 3 escape patterns.
uriSafe | ( | $spacer = "-" | ) |
Processes the string and replaces all accented UTF-8 characters by unaccented ASCII-7 "equivalents", whitespaces are replaced by a pre-defined spacer and the string is lowercase.
string | $spacer |