ts3phpframework
|
Helper class for string handling. More...
Public Member Functions | |
__construct (string $string) | |
replace (array|string $search, array|string $replace, bool $caseSensitivity=true) | |
arg (array $args, string $char="%") | |
startsWith (string $pattern) | |
endsWith (string $pattern) | |
findFirst (string $needle) | |
findLast (string $needle) | |
toLower () | |
toUpper () | |
contains (string $pattern, bool $regexp=false) | |
substr (int $start, int $length=null) | |
split (string $separator, int $limit=0) | |
append (string $part) | |
prepend (string $part) | |
section (string $separator, int $first=0, int $last=0) | |
resize (int $size, string $char="\0") | |
trim () | |
escape () | |
unescape () | |
filterAlnum () | |
filterAlpha () | |
filterDigits () | |
isInt () | |
toInt () | |
toCrc32 () | |
toMd5 () | |
toSha1 () | |
isUtf8 () | |
toUtf8 () | |
toBase64 () | |
toHex () | |
transliterate () | |
uriSafe (string $spacer="-") | |
spaceToPercent () | |
toString () | |
__call (string $function, array $args) | |
__toString () | |
jsonSerialize () | |
count () | |
rewind () | |
valid () | |
key () | |
current () | |
next () | |
offsetExists ($offset) | |
offsetGet ($offset) | |
offsetSet ($offset, $value) | |
offsetUnset ($offset) |
Static Public Member Functions | |
static | factory (string $string) |
static | fromBase64 (string $base64) |
static | fromHex (string $hex) |
Protected Attributes | |
string | $string |
int | $position = 0 |
Helper class for string handling.
Definition at line 18 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::__construct | ( | string | $string | ) |
The StringHelper constructor.
string | $string |
Definition at line 38 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::__call | ( | string | $function, |
array | $args ) |
Magical function that allows you to call PHP's built-in string functions on the PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper object.
string | $function | |
array | $args |
HelperException |
Definition at line 781 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::__toString | ( | ) |
Returns the character as a standard string.
Definition at line 813 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::append | ( | string | $part | ) |
Appends $part to the string.
string | $part |
Definition at line 216 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::arg | ( | array | $args, |
string | $char = "%" ) |
This function replaces indexed or associative signs with given values.
array | $args | |
string | $char |
Definition at line 80 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::contains | ( | string | $pattern, |
bool | $regexp = false ) |
Returns true if the string contains $pattern.
string | $pattern | |
boolean | $regexp |
Definition at line 165 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::count | ( | ) |
@ignore
Definition at line 831 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::current | ( | ) |
HelperException | @ignore |
Definition at line 864 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::endsWith | ( | string | $pattern | ) |
Returns true if the string ends with $pattern.
string | $pattern |
Definition at line 111 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::escape | ( | ) |
Escapes a string using the TeamSpeak 3 escape patterns.
Definition at line 305 of file StringHelper.php.
|
static |
Returns a StringHelper object for the given string.
string | $string |
Definition at line 49 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::filterAlnum | ( | ) |
Removes any non-alphanumeric characters from the string.
Definition at line 331 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::filterAlpha | ( | ) |
Removes any non-alphabetic characters from the string.
Definition at line 343 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::filterDigits | ( | ) |
Removes any non-numeric characters from the string.
Definition at line 355 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::findFirst | ( | string | $needle | ) |
Returns the position of the first occurrence of a char in a string.
string | $needle |
Definition at line 122 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::findLast | ( | string | $needle | ) |
Returns the position of the last occurrence of a char in a string.
string | $needle |
Definition at line 133 of file StringHelper.php.
|
static |
Decodes the string with MIME base64 and returns the result as an PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper
string | $base64 |
Definition at line 472 of file StringHelper.php.
|
static |
Returns the PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper based on a given hex value.
string | $hex |
HelperException |
Definition at line 500 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::isInt | ( | ) |
Returns TRUE if the string is a numeric value.
Definition at line 367 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::isUtf8 | ( | ) |
Returns TRUE if the string is UTF-8 encoded. This method searches for non-ascii multibyte sequences in the UTF-8 range.
Definition at line 427 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::jsonSerialize | ( | ) |
Return UTF-8 encoded string to for serializing to JSON.
Definition at line 823 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::key | ( | ) |
@ignore
Definition at line 855 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::next | ( | ) |
@ignore
Definition at line 872 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::offsetExists | ( | $offset | ) |
@ignore
Definition at line 880 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::offsetGet | ( | $offset | ) |
HelperException | @ignore |
Definition at line 889 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::offsetSet | ( | $offset, | |
$value ) |
@ignore
Definition at line 897 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::offsetUnset | ( | $offset | ) |
@ignore
Definition at line 909 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::prepend | ( | string | $part | ) |
Prepends $part to the string.
string | $part |
Definition at line 229 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::replace | ( | array|string | $search, |
array|string | $replace, | ||
bool | $caseSensitivity = true ) |
Replaces every occurrence of the string or array $search with the string or array $replace.
array | string | $search | |
array | string | $replace | |
boolean | $caseSensitivity |
Definition at line 62 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::resize | ( | int | $size, |
string | $char = "\0" ) |
Sets the size of the string to $size characters.
integer | $size | |
string | $char |
Definition at line 275 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::rewind | ( | ) |
@ignore
Definition at line 839 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::section | ( | string | $separator, |
int | $first = 0, | ||
int | $last = 0 ) |
Returns a section of the string.
string | $separator | |
integer | $first | |
integer | $last |
Definition at line 244 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::spaceToPercent | ( | ) |
Replaces space characters with percent encoded strings.
Definition at line 758 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::split | ( | string | $separator, |
int | $limit = 0 ) |
Splits the string into substrings wherever $separator occurs.
string | $separator | |
integer | $limit |
Definition at line 199 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::startsWith | ( | string | $pattern | ) |
Returns true if the string starts with $pattern.
string | $pattern |
Definition at line 100 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::substr | ( | int | $start, |
int | $length = null ) |
Returns part of a string.
integer | $start | |
integer | null | $length |
Definition at line 185 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toBase64 | ( | ) |
Encodes the string with MIME base64 and returns the result.
Definition at line 461 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toCrc32 | ( | ) |
Calculates and returns the crc32 polynomial of the string.
Definition at line 396 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toHex | ( | ) |
Returns the hexadecimal value of the string.
Definition at line 482 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toInt | ( | ) |
Returns the integer value of the string.
Definition at line 382 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toLower | ( | ) |
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toMd5 | ( | ) |
Calculates and returns the md5 checksum of the string.
Definition at line 406 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toSha1 | ( | ) |
Calculates and returns the sha1 checksum of the string.
Definition at line 416 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toString | ( | ) |
Returns the string as a standard string
Definition at line 768 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toUpper | ( | ) |
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::toUtf8 | ( | ) |
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::transliterate | ( | ) |
Returns the string transliterated from UTF-8 to Latin.
Definition at line 520 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::trim | ( | ) |
Strips whitespaces (or other characters) from the beginning and end of the string.
Definition at line 293 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::unescape | ( | ) |
Unescapes a string using the TeamSpeak 3 escape patterns.
Definition at line 319 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::uriSafe | ( | string | $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 |
Definition at line 743 of file StringHelper.php.
PlanetTeamSpeak\TeamSpeak3Framework\Helper\StringHelper::valid | ( | ) |
@ignore
Definition at line 847 of file StringHelper.php.
|
protected |
Definition at line 31 of file StringHelper.php.
|
protected |
Definition at line 25 of file StringHelper.php.