Helper class for char handling.
More...
Helper class for char handling.
Definition at line 32 of file Char.php.
| TeamSpeak3_Helper_Char::__construct |
( |
|
$char) | |
|
| TeamSpeak3_Helper_Char::isLetter |
( |
) | |
|
Returns true if the character is a letter.
- Returns
- boolean
Definition at line 63 of file Char.php.
65 return ctype_alpha($this->
char);
| TeamSpeak3_Helper_Char::isDigit |
( |
) | |
|
Returns true if the character is a decimal digit.
- Returns
- boolean
Definition at line 73 of file Char.php.
75 return ctype_digit($this->
char);
| TeamSpeak3_Helper_Char::isSpace |
( |
) | |
|
Returns true if the character is a space.
- Returns
- boolean
Definition at line 83 of file Char.php.
85 return ctype_space($this->
char);
| TeamSpeak3_Helper_Char::isMark |
( |
) | |
|
Returns true if the character is a mark.
- Returns
- boolean
Definition at line 93 of file Char.php.
95 return ctype_punct($this->
char);
| TeamSpeak3_Helper_Char::isControl |
( |
) | |
|
Returns true if the character is a control character (i.e.
"\t").
- Returns
- boolean
Definition at line 103 of file Char.php.
105 return ctype_cntrl($this->
char);
| TeamSpeak3_Helper_Char::isPrintable |
( |
) | |
|
Returns true if the character is a printable character.
- Returns
- boolean
Definition at line 113 of file Char.php.
115 return ctype_print($this->
char);
| TeamSpeak3_Helper_Char::isNull |
( |
) | |
|
Returns true if the character is the Unicode character 0x0000 ("\0").
- Returns
- boolean
Definition at line 123 of file Char.php.
125 return ($this->
char ===
"\0") ? TRUE : FALSE;
| TeamSpeak3_Helper_Char::isUpper |
( |
) | |
|
Returns true if the character is an uppercase letter.
- Returns
- boolean
Definition at line 133 of file Char.php.
Referenced by toUpper().
135 return ($this->
char === strtoupper($this->
char)) ? TRUE : FALSE;
| TeamSpeak3_Helper_Char::isLower |
( |
) | |
|
Returns true if the character is a lowercase letter.
- Returns
- boolean
Definition at line 143 of file Char.php.
Referenced by toLower().
145 return ($this->
char === strtolower($this->
char)) ? TRUE : FALSE;
| TeamSpeak3_Helper_Char::toUpper |
( |
) | |
|
| TeamSpeak3_Helper_Char::toLower |
( |
) | |
|
| TeamSpeak3_Helper_Char::toAscii |
( |
) | |
|
Returns the ascii value of the character.
- Returns
- integer
Definition at line 173 of file Char.php.
Referenced by toHex().
175 return ord($this->
char);
| TeamSpeak3_Helper_Char::toUnicode |
( |
) | |
|
Returns the Unicode value of the character.
- Returns
- integer
Definition at line 183 of file Char.php.
185 $h = ord($this->
char{0});
197 return ($h & 0x1F) << 6 | (ord($this->
char{1}) & 0x3F);
201 return ($h & 0x0F) << 12 | (ord($this->
char{1}) & 0x3F) << 6 | (ord($this->
char{2}) & 0x3F);
205 return ($h & 0x0F) << 18 | (ord($this->
char{1}) & 0x3F) << 12 | (ord($this->
char{2}) & 0x3F) << 6 | (ord($this->
char{3}) & 0x3F);
| TeamSpeak3_Helper_Char::toHex |
( |
) | |
|
Returns the hexadecimal value of the char.
- Returns
- string
Definition at line 218 of file Char.php.
References toAscii().
220 return strtoupper(dechex($this->
toAscii()));
| static TeamSpeak3_Helper_Char::fromHex |
( |
|
$hex) | |
|
|
static |
| TeamSpeak3_Helper_Char::toString |
( |
) | |
|
Returns the character as a standard string.
- Returns
- string
Definition at line 245 of file Char.php.
| TeamSpeak3_Helper_Char::toInt |
( |
) | |
|
Returns the integer value of the character.
- Returns
- integer
Definition at line 255 of file Char.php.
257 return intval($this->
char);
| TeamSpeak3_Helper_Char::__toString |
( |
) | |
|
Returns the character as a standard string.
- Returns
- string
Definition at line 265 of file Char.php.
The documentation for this class was generated from the following file: