프로퍼티 | 타입 | 설명 | |
---|---|---|---|
$byteIdx | integer | For ASCII strings, the byte index is equal to the character index. | |
$byteLen | integer | The length of the string (in bytes). | |
$charIdx | integer | For non-ASCII strings, some characters occupy more than one byte and the character index will have a lower value than the byte index. | |
$charLen | integer | The length of the string (in characters). | |
$str | string | The raw, multi-byte string. |
메소드 | 설명 | |
---|---|---|
__construct ( string $str ) | Constructor. | |
__toString ( ) : string | Returns the contained string. | |
getCharLength ( string $byte ) : integer | Gets the length of an UTF-8 character. | |
length ( ) : integer | Returns the length in characters of the string. | |
offsetExists ( integer $offset ) : boolean | Checks if the given offset exists. | |
offsetGet ( integer $offset ) : string | Gets the character at given offset. | |
offsetSet ( integer $offset, string $value ) : void | Sets the value of a character. | |
offsetUnset ( integer $offset ) : void | Unsets an index. |
public static getCharLength ( string $byte ) : integer | ||
$byte | string | The byte to be analyzed. |
리턴 | integer |
public offsetExists ( integer $offset ) : boolean | ||
$offset | integer | The offset to be checked. |
리턴 | boolean |
public offsetUnset ( integer $offset ) : void | ||
$offset | integer | The value to be unset. |
리턴 | void |
public int $byteIdx | ||
리턴 | integer |
public int $charIdx | ||
리턴 | integer |