TeamSpeak 3 PHP Framework  1.1.16
Copyright © Planet TeamSpeak. All rights reserved.
 All Classes Namespaces Files Functions Variables Pages
TeamSpeak3_Helper_String Class Reference

Helper class for string handling. More...

+ Inheritance diagram for TeamSpeak3_Helper_String:

Public Member Functions

 __construct ($string)
 The TeamSpeak3_Helper_String constructor.
 
 replace ($search, $replace, $caseSensitivity=TRUE)
 Replaces every occurrence of the string $search with the string $replace.
 
 arg (array $args, $char="%")
 This function replaces indexed or associative signs with given values.
 
 startsWith ($pattern)
 Returns true if the string starts with $pattern.
 
 endsWith ($pattern)
 Returns true if the string ends with $pattern.
 
 findFirst ($needle)
 Returns the position of the first occurrence of a char in a string.
 
 findLast ($needle)
 Returns the position of the last occurrence of a char in a string.
 
 toLower ()
 Returns the lowercased string.
 
 toUpper ()
 Returns the uppercased string.
 
 contains ($pattern, $regexp=FALSE)
 Returns true if the string contains $pattern.
 
 substr ($start, $length=null)
 Returns part of a string.
 
 split ($separator, $limit=0)
 Splits the string into substrings wherever $separator occurs.
 
 append ($part)
 Appends $part to the string.
 
 prepend ($part)
 Prepends $part to the string.
 
 section ($separator, $first=0, $last=0)
 Returns a section of the string.
 
 resize ($size, $char="\0")
 Sets the size of the string to $size characters.
 
 trim ()
 Strips whitespaces (or other characters) from the beginning and end of the string.
 
 escape ()
 Escapes a string using the TeamSpeak 3 escape patterns.
 
 unescape ()
 Unescapes a string using the TeamSpeak 3 escape patterns.
 
 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.
 
 isInt ()
 Returns TRUE if the string is a numeric value.
 
 toInt ()
 Returns the integer value of the string.
 
 toCrc32 ()
 Calculates and returns the crc32 polynomial of the string.
 
 toMd5 ()
 Calculates and returns the md5 checksum of the string.
 
 toSha1 ()
 Calculates and returns the sha1 checksum of the string.
 
 isUtf8 ()
 Returns TRUE if the string is UTF-8 encoded.
 
 toUtf8 ()
 Converts the string to UTF-8.
 
 toBase64 ()
 Encodes the string with MIME base64 and returns the result.
 
 toHex ()
 Returns the hexadecimal value of the string.
 
 transliterate ()
 Returns the string transliterated from UTF-8 to Latin.
 
 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.
 
 spaceToPercent ()
 Replaces space characters with percent encoded strings.
 
 toString ()
 Returns the string as a standard string.
 
 __call ($function, $args)
 Magical function that allows you to call PHP's built-in string functions on the TeamSpeak3_Helper_String object.
 
 __toString ()
 Returns the character as a standard string.
 
 count ()
 
 
 rewind ()
 
 
 valid ()
 
 
 key ()
 
 
 current ()
 
 
 next ()
 
 
 offsetExists ($offset)
 
 
 offsetGet ($offset)
 
 
 offsetSet ($offset, $value)
 
 
 offsetUnset ($offset)
 
 

Static Public Member Functions

static factory ($string)
 Returns a TeamSpeak3_Helper_String object for thegiven string.
 
static fromBase64 ($base64)
 Decodes the string with MIME base64 and returns the result as an TeamSpeak3_Helper_String.
 
static fromHex ($hex)
 Returns the TeamSpeak3_Helper_String based on a given hex value.
 

Protected Attributes

 $string
 
 $position = 0
 
 

Detailed Description

Helper class for string handling.

Definition at line 32 of file String.php.

Constructor & Destructor Documentation

TeamSpeak3_Helper_String::__construct (   $string)

The TeamSpeak3_Helper_String constructor.

Parameters
string$string
Returns
TeamSpeak3_Helper_String

Definition at line 52 of file String.php.

{
$this->string = strval($string);
}

Member Function Documentation

TeamSpeak3_Helper_String::replace (   $search,
  $replace,
  $caseSensitivity = TRUE 
)

Replaces every occurrence of the string $search with the string $replace.

Parameters
string$search
string$replace
boolean$caseSensitivity
Returns
TeamSpeak3_Helper_String

Definition at line 76 of file String.php.

{
if($caseSensitivity)
{
$this->string = str_replace($search, $replace, $this->string);
}
else
{
$this->string = str_ireplace($search, $replace, $this->string);
}
return $this;
}
TeamSpeak3_Helper_String::arg ( array  $args,
  $char = "%" 
)

This function replaces indexed or associative signs with given values.

Parameters
array$args
string$char
Returns
TeamSpeak3_Helper_String

Definition at line 97 of file String.php.

Referenced by TeamSpeak3_Exception\prepareCustomMessage().

{
$args = array_reverse($args, TRUE);
foreach($args as $key => $val)
{
$args[$char . $key] = $val;
unset($args[$key]);
}
$this->string = strtr($this->string, $args);
return $this;
}
TeamSpeak3_Helper_String::startsWith (   $pattern)

Returns true if the string starts with $pattern.

Parameters
string$pattern
Returns
boolean

Definition at line 118 of file String.php.

References substr().

Referenced by TeamSpeak3_Adapter_ServerQuery_Event\__construct().

{
return (substr($this->string, 0, strlen($pattern)) == $pattern) ? TRUE : FALSE;
}
TeamSpeak3_Helper_String::endsWith (   $pattern)

Returns true if the string ends with $pattern.

Parameters
string$pattern
Returns
boolean

Definition at line 129 of file String.php.

References substr().

{
return (substr($this->string, strlen($pattern)*-1) == $pattern) ? TRUE : FALSE;
}
TeamSpeak3_Helper_String::findFirst (   $needle)

Returns the position of the first occurrence of a char in a string.

Parameters
string$needle
Returns
integer

Definition at line 140 of file String.php.

{
return strpos($this->string, $needle);
}
TeamSpeak3_Helper_String::findLast (   $needle)

Returns the position of the last occurrence of a char in a string.

Parameters
string$needle
Returns
integer

Definition at line 151 of file String.php.

{
return strrpos($this->string, $needle);
}
TeamSpeak3_Helper_String::toLower ( )

Returns the lowercased string.

Returns
TeamSpeak3_Helper_String

Definition at line 161 of file String.php.

{
return new self(strtolower($this->string));
}
TeamSpeak3_Helper_String::toUpper ( )

Returns the uppercased string.

Returns
TeamSpeak3_Helper_String

Definition at line 171 of file String.php.

{
return new self(strtoupper($this->string));
}
TeamSpeak3_Helper_String::contains (   $pattern,
  $regexp = FALSE 
)

Returns true if the string contains $pattern.

Parameters
string$pattern
booean$regexp
Returns
boolean

Definition at line 183 of file String.php.

Referenced by isInt().

{
if(empty($pattern))
{
return TRUE;
}
if($regexp)
{
return (preg_match("/" . $pattern . "/i", $this->string)) ? TRUE : FALSE;
}
else
{
return (stristr($this->string, $pattern) !== FALSE) ? TRUE : FALSE;
}
}
TeamSpeak3_Helper_String::substr (   $start,
  $length = null 
)

Returns part of a string.

Parameters
integer$start
integer$length
Returns
TeamSpeak3_Helper_String

Definition at line 207 of file String.php.

Referenced by endsWith(), resize(), and startsWith().

{
$string = ($length !== null) ? substr($this->string, $start, $length) : substr($this->string, $start);
return new self($string);
}
TeamSpeak3_Helper_String::split (   $separator,
  $limit = 0 
)

Splits the string into substrings wherever $separator occurs.

Parameters
string$separator
integer$limit
Returns
array

Definition at line 221 of file String.php.

References count().

Referenced by TeamSpeak3_Adapter_ServerQuery_Event\__construct().

{
$parts = explode($separator, $this->string, ($limit) ? intval($limit) : $this->count());
foreach($parts as $key => $val)
{
$parts[$key] = new self($val);
}
return $parts;
}
TeamSpeak3_Helper_String::append (   $part)

Appends $part to the string.

Parameters
string$part
Returns
TeamSpeak3_Helper_String

Definition at line 239 of file String.php.

{
$this->string = $this->string . strval($part);
return $this;
}
TeamSpeak3_Helper_String::prepend (   $part)

Prepends $part to the string.

Parameters
string$part
Returns
TeamSpeak3_Helper_String

Definition at line 252 of file String.php.

{
$this->string = strval($part) . $this->string;
return $this;
}
TeamSpeak3_Helper_String::section (   $separator,
  $first = 0,
  $last = 0 
)

Returns a section of the string.

Parameters
string$separator
integer$first
integer$last
Returns
TeamSpeak3_Helper_String

Definition at line 267 of file String.php.

References count().

Referenced by TeamSpeak3_Adapter_ServerQuery\request(), and TeamSpeak3_Adapter_ServerQuery\wait().

{
$sections = explode($separator, $this->string);
$total = count($sections);
$first = intval($first);
$last = intval($last);
if($first > $total) return null;
if($first > $last) $last = $first;
for($i = 0; $i < $total; $i++)
{
if($i < $first || $i > $last)
{
unset($sections[$i]);
}
}
$string = implode($separator, $sections);
return new self($string);
}
TeamSpeak3_Helper_String::resize (   $size,
  $char = "\0" 
)

Sets the size of the string to $size characters.

Parameters
integer$size
string$char
Returns
TeamSpeak3_Helper_String

Definition at line 298 of file String.php.

References count(), and substr().

{
$chars = ($size - $this->count());
if($chars < 0)
{
$this->string = substr($this->string, 0, $chars);
}
elseif($chars > 0)
{
$this->string = str_pad($this->string, $size, strval($char));
}
return $this;
}
TeamSpeak3_Helper_String::trim ( )

Strips whitespaces (or other characters) from the beginning and end of the string.

Returns
TeamSpeak3_Helper_String

Definition at line 319 of file String.php.

Referenced by uriSafe().

{
$this->string = trim($this->string);
return $this;
}
TeamSpeak3_Helper_String::escape ( )

Escapes a string using the TeamSpeak 3 escape patterns.

Returns
TeamSpeak3_Helper_String

Definition at line 331 of file String.php.

References TeamSpeak3\getEscapePatterns().

{
foreach(TeamSpeak3::getEscapePatterns() as $search => $replace)
{
$this->string = str_replace($search, $replace, $this->string);
}
return $this;
}
TeamSpeak3_Helper_String::unescape ( )

Unescapes a string using the TeamSpeak 3 escape patterns.

Returns
TeamSpeak3_Helper_String

Definition at line 346 of file String.php.

References TeamSpeak3\getEscapePatterns().

{
$this->string = strtr($this->string, array_flip(TeamSpeak3::getEscapePatterns()));
return $this;
}
TeamSpeak3_Helper_String::filterAlnum ( )

Removes any non alphanumeric characters from the string.

Returns
TeamSpeak3_Helper_String

Definition at line 358 of file String.php.

{
$this->string = preg_replace("/[^[:alnum:]]/", "", $this->string);
return $this;
}
TeamSpeak3_Helper_String::filterAlpha ( )

Removes any non alphabetic characters from the string.

Returns
TeamSpeak3_Helper_String

Definition at line 370 of file String.php.

{
$this->string = preg_replace("/[^[:alpha:]]/", "", $this->string);
return $this;
}
TeamSpeak3_Helper_String::filterDigits ( )

Removes any non numeric characters from the string.

Returns
TeamSpeak3_Helper_String

Definition at line 382 of file String.php.

{
$this->string = preg_replace("/[^[:digit:]]/", "", $this->string);
return $this;
}
TeamSpeak3_Helper_String::isInt ( )

Returns TRUE if the string is a numeric value.

Returns
boolean

Definition at line 394 of file String.php.

References contains().

{
return (is_numeric($this->string) && !$this->contains(".")) ? TRUE : FALSE;
}
TeamSpeak3_Helper_String::toInt ( )

Returns the integer value of the string.

Returns
float
integer

Definition at line 405 of file String.php.

{
if($this->string == pow(2, 63) || $this->string == pow(2, 64))
{
return -1;
}
return ($this->string > pow(2, 31)) ? floatval($this->string) : intval($this->string);
}
TeamSpeak3_Helper_String::toCrc32 ( )

Calculates and returns the crc32 polynomial of the string.

Returns
string

Definition at line 420 of file String.php.

{
return crc32($this->string);
}
TeamSpeak3_Helper_String::toMd5 ( )

Calculates and returns the md5 checksum of the string.

Returns
string

Definition at line 430 of file String.php.

{
return md5($this->string);
}
TeamSpeak3_Helper_String::toSha1 ( )

Calculates and returns the sha1 checksum of the string.

Returns
string

Definition at line 440 of file String.php.

{
return sha1($this->string);
}
TeamSpeak3_Helper_String::isUtf8 ( )

Returns TRUE if the string is UTF-8 encoded.

This method searches for non-ascii multibyte sequences in the UTF-8 range.

Returns
boolean

Definition at line 451 of file String.php.

Referenced by toUtf8().

{
//return (utf8_encode(utf8_decode($this->string)) == $this->string) ? TRUE : FALSE;
$pattern = array();
$pattern[] = "[\xC2-\xDF][\x80-\xBF]"; // non-overlong 2-byte
$pattern[] = "\xE0[\xA0-\xBF][\x80-\xBF]"; // excluding overlongs
$pattern[] = "[\xE1-\xEC\xEE\xEF][\x80-\xBF]{2}"; // straight 3-byte
$pattern[] = "\xED[\x80-\x9F][\x80-\xBF]"; // excluding surrogates
$pattern[] = "\xF0[\x90-\xBF][\x80-\xBF]{2}"; // planes 1-3
$pattern[] = "[\xF1-\xF3][\x80-\xBF]{3}"; // planes 4-15
$pattern[] = "\xF4[\x80-\x8F][\x80-\xBF]{2}"; // plane 16
return preg_match("%(?:" . implode("|", $pattern) . ")+%xs", $this->string);
}
TeamSpeak3_Helper_String::toUtf8 ( )

Converts the string to UTF-8.

Returns
TeamSpeak3_Helper_String

Definition at line 473 of file String.php.

References isUtf8().

Referenced by transliterate().

{
if(!$this->isUtf8())
{
$this->string = utf8_encode($this->string);
}
return $this;
}
TeamSpeak3_Helper_String::toBase64 ( )

Encodes the string with MIME base64 and returns the result.

Returns
string

Definition at line 488 of file String.php.

{
return base64_encode($this->string);
}
static TeamSpeak3_Helper_String::fromBase64 (   $base64)
static

Decodes the string with MIME base64 and returns the result as an TeamSpeak3_Helper_String.

Parameters
string
Returns
TeamSpeak3_Helper_String

Definition at line 499 of file String.php.

Referenced by TeamSpeak3_Node_Server\snapshotDeploy().

{
return new self(base64_decode($base64));
}
TeamSpeak3_Helper_String::toHex ( )

Returns the hexadecimal value of the string.

Returns
string

Definition at line 509 of file String.php.

{
$hex = "";
foreach($this as $char)
{
$hex .= $char->toHex();
}
return $hex;
}
static TeamSpeak3_Helper_String::fromHex (   $hex)
static

Returns the TeamSpeak3_Helper_String based on a given hex value.

Parameters
string
Exceptions
TeamSpeak3_Helper_Exception
Returns
TeamSpeak3_Helper_String

Definition at line 528 of file String.php.

Referenced by TeamSpeak3_Node_Server\snapshotDeploy(), and TeamSpeak3_Adapter_Update\syn().

{
$string = "";
if(strlen($hex)%2 == 1)
{
throw new TeamSpeak3_Helper_Exception("given parameter '" . $hex . "' is not a valid hexadecimal number");
}
foreach(str_split($hex, 2) as $chunk)
{
$string .= chr(hexdec($chunk));
}
return new self($string);
}
TeamSpeak3_Helper_String::transliterate ( )

Returns the string transliterated from UTF-8 to Latin.

Returns
TeamSpeak3_Helper_String

Definition at line 550 of file String.php.

References toUtf8().

Referenced by uriSafe().

{
$utf8_accents = array(
"à" => "a",
"ô" => "o",
"Ä?" => "d",
"ḟ" => "f",
"ë" => "e",
"Å¡" => "s",
"Æ¡" => "o",
"ß" => "ss",
"ă" => "a",
"Å™" => "r",
"È›" => "t",
"ň" => "n",
"Ä?" => "a",
"Ä·" => "k",
"Å?" => "s",
"ỳ" => "y",
"ņ" => "n",
"ĺ" => "l",
"ħ" => "h",
"á¹—" => "p",
"ó" => "o",
"ú" => "u",
"Ä›" => "e",
"é" => "e",
"ç" => "c",
"�" => "w",
"Ä‹" => "c",
"õ" => "o",
"ṡ" => "s",
"ø" => "o",
"Ä£" => "g",
"ŧ" => "t",
"È™" => "s",
"Ä—" => "e",
"ĉ" => "c",
"Å›" => "s",
"î" => "i",
"ű" => "u",
"ć" => "c",
"Ä™" => "e",
"ŵ" => "w",
"ṫ" => "t",
"Å«" => "u",
"Ä?" => "c",
"ö" => "oe",
"è" => "e",
"Å·" => "y",
"Ä…" => "a",
"Å‚" => "l",
"ų" => "u",
"ů" => "u",
"ÅŸ" => "s",
"ÄŸ" => "g",
"ļ" => "l",
"Æ’" => "f",
"ž" => "z",
"ẃ" => "w",
"ḃ" => "b",
"Ã¥" => "a",
"ì" => "i",
"ï" => "i",
"ḋ" => "d",
"Å¥" => "t",
"Å—" => "r",
"ä" => "ae",
"í" => "i",
"Å•" => "r",
"ê" => "e",
"ü" => "ue",
"ò" => "o",
"Ä“" => "e",
"ñ" => "n",
"Å„" => "n",
"Ä¥" => "h",
"Ä?" => "g",
"Ä‘" => "d",
"ĵ" => "j",
"ÿ" => "y",
"Å©" => "u",
"Å­" => "u",
"ư" => "u",
"Å£" => "t",
"ý" => "y",
"Å‘" => "o",
"â" => "a",
"ľ" => "l",
"ẅ" => "w",
"ż" => "z",
"Ä«" => "i",
"ã" => "a",
"Ä¡" => "g",
"á¹?" => "m",
"Å?" => "o",
"Ä©" => "i",
"ù" => "u",
"į" => "i",
"ź" => "z",
"á" => "a",
"û" => "u",
"þ" => "th",
"ð" => "dh",
"æ" => "ae",
"µ" => "u",
"Ä•" => "e",
"Å“" => "oe",
"À" => "A",
"Ô" => "O",
"ÄŽ" => "D",
"Ḟ" => "F",
"Ë" => "E",
"Å " => "S",
"Æ " => "O",
"Ä‚" => "A",
"Ř" => "R",
"Èš" => "T",
"Ň" => "N",
"Ä€" => "A",
"Ķ" => "K",
"Ŝ" => "S",
"Ỳ" => "Y",
"Å…" => "N",
"Ĺ" => "L",
"Ħ" => "H",
"á¹–" => "P",
"Ó" => "O",
"Ú" => "U",
"Äš" => "E",
"É" => "E",
"Ç" => "C",
"Ẁ" => "W",
"ÄŠ" => "C",
"Õ" => "O",
"á¹ " => "S",
"Ø" => "O",
"Ä¢" => "G",
"Ŧ" => "T",
"Ș" => "S",
"Ä–" => "E",
"Ĉ" => "C",
"Åš" => "S",
"ÃŽ" => "I",
"Ű" => "U",
"Ć" => "C",
"Ę" => "E",
"Å´" => "W",
"Ṫ" => "T",
"Ū" => "U",
"Č" => "C",
"Ö" => "Oe",
"È" => "E",
"Ŷ" => "Y",
"Ä„" => "A",
"Å?" => "L",
"Ų" => "U",
"Å®" => "U",
"Åž" => "S",
"Äž" => "G",
"Ä»" => "L",
"Æ‘" => "F",
"Ž" => "Z",
"Ẃ" => "W",
"Ḃ" => "B",
"Ã…" => "A",
"Ì" => "I",
"Ã?" => "I",
"Ḋ" => "D",
"Ť" => "T",
"Å–" => "R",
"Ä" => "Ae",
"Ã?" => "I",
"Å”" => "R",
"Ê" => "E",
"Ü" => "Ue",
"Ã’" => "O",
"Ä’" => "E",
"Ñ" => "N",
"Ń" => "N",
"Ĥ" => "H",
"Ĝ" => "G",
"Ä?" => "D",
"Ä´" => "J",
"Ÿ" => "Y",
"Ũ" => "U",
"Ŭ" => "U",
"Ư" => "U",
"Å¢" => "T",
"Ã?" => "Y",
"Å?" => "O",
"Â" => "A",
"Ľ" => "L",
"Ẅ" => "W",
"Å»" => "Z",
"Ī" => "I",
"Ã" => "A",
"Ä " => "G",
"á¹€" => "M",
"Ō" => "O",
"Ĩ" => "I",
"Ù" => "U",
"Ä®" => "I",
"Ź" => "Z",
"Ã?" => "A",
"Û" => "U",
"Þ" => "Th",
"Ã?" => "Dh",
"Æ" => "Ae",
"Ä”" => "E",
"Å’" => "Oe",
);
return new self($this->toUtf8()->replace(array_keys($utf8_accents), array_values($utf8_accents)));
}
TeamSpeak3_Helper_String::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.

Parameters
string$spacer
Returns
TeamSpeak3_Helper_String

Definition at line 773 of file String.php.

References transliterate(), and trim().

{
$this->string = str_replace($spacer, " ", $this->string);
$this->string = $this->transliterate();
$this->string = preg_replace("/(\s|[^A-Za-z0-9\-])+/", $spacer, trim(strtolower($this->string)));
$this->string = trim($this->string, $spacer);
return new self($this->string);
}
TeamSpeak3_Helper_String::spaceToPercent ( )

Replaces space characters with percent encoded strings.

Returns
string

Definition at line 788 of file String.php.

{
return str_replace(" ", "%20", $this->string);
}
TeamSpeak3_Helper_String::toString ( )

Returns the string as a standard string.

Returns
string

Definition at line 798 of file String.php.

{
return $this->string;
}
TeamSpeak3_Helper_String::__call (   $function,
  $args 
)

Magical function that allows you to call PHP's built-in string functions on the TeamSpeak3_Helper_String object.

Parameters
string$function
array$args
Exceptions
TeamSpeak3_Helper_Exception
Returns
TeamSpeak3_Helper_String

Definition at line 811 of file String.php.

References count().

{
if(!function_exists($function))
{
throw new TeamSpeak3_Helper_Exception("cannot call undefined function '" . $function . "' on this object");
}
if(count($args))
{
if(($key = array_search($this, $args, TRUE)) !== FALSE)
{
$args[$key] = $this->string;
}
else
{
throw new TeamSpeak3_Helper_Exception("cannot call undefined function '" . $function . "' without the " . __CLASS__ . " object parameter");
}
$return = call_user_func_array($function, $args);
}
else
{
$return = call_user_func($function, $this->string);
}
if(is_string($return))
{
$this->string = $return;
}
else
{
return $return;
}
return $this;
}
TeamSpeak3_Helper_String::__toString ( )

Returns the character as a standard string.

Returns
string

Definition at line 853 of file String.php.

{
return (string) $this->string;
}
TeamSpeak3_Helper_String::count ( )

Definition at line 861 of file String.php.

Referenced by __call(), resize(), section(), split(), and valid().

{
return strlen($this->string);
}
TeamSpeak3_Helper_String::rewind ( )

Definition at line 869 of file String.php.

{
$this->position = 0;
}
TeamSpeak3_Helper_String::valid ( )

Definition at line 877 of file String.php.

References count().

{
return $this->position < $this->count();
}
TeamSpeak3_Helper_String::key ( )

Definition at line 885 of file String.php.

References $position.

{
}
TeamSpeak3_Helper_String::current ( )

Definition at line 893 of file String.php.

{
return new TeamSpeak3_Helper_Char($this->string{$this->position});
}
TeamSpeak3_Helper_String::next ( )

Definition at line 901 of file String.php.

{
$this->position++;
}
TeamSpeak3_Helper_String::offsetExists (   $offset)

Definition at line 909 of file String.php.

Referenced by offsetGet(), offsetSet(), and offsetUnset().

{
return ($offset < strlen($this->string)) ? TRUE : FALSE;
}
TeamSpeak3_Helper_String::offsetGet (   $offset)

Definition at line 917 of file String.php.

References offsetExists().

{
return ($this->offsetExists($offset)) ? new TeamSpeak3_Helper_Char($this->string{$offset}) : null;
}
TeamSpeak3_Helper_String::offsetSet (   $offset,
  $value 
)

Definition at line 925 of file String.php.

References offsetExists().

{
if(!$this->offsetExists($offset)) return;
$this->string{$offset} = strval($value);
}
TeamSpeak3_Helper_String::offsetUnset (   $offset)

Definition at line 935 of file String.php.

References offsetExists().

{
if(!$this->offsetExists($offset)) return;
$this->string = substr_replace($this->string, "", $offset, 1);
}

Member Data Documentation

TeamSpeak3_Helper_String::$position = 0
protected

Definition at line 44 of file String.php.

Referenced by key().


The documentation for this class was generated from the following file: