YANA 4 PHP Framework
Docs For Class String
«datatype» String
This is an OO-wrapper for the scalar string type of PHP. This implementation is compatible with PHP 4 and 5.
}
Located in /includes/class_string.php
Object | --String
Name | Type | Description |
---|---|---|
$stringValue | string | |
$value |
Creates a new string wrapper. The input must be convertable to a string value.
Name | Type | Description |
---|---|---|
$charlist | string | a string of characters that should be escaped |
Name | Type | Description |
---|---|---|
$index | int | position of the character (starting with 0) |
Returns bool(false) on error. Issues an E_USER_ERROR if $index is of wrong type. Issues an E_USER_NOTICE if $index is out of bounds.
Note that indices are numbered starting with '0'.
creates a copy of this object
Redefinition of: Object::cloneObject()
Name | Type | Description |
---|---|---|
$anotherString | string | some other string |
Returns
Note: This function is case-sensitive.
Name | Type | Description |
---|---|---|
$anotherString | string | some other string |
Returns
Note: This function is NOT case-sensitive.
Name | Type | Description |
---|---|---|
$encoding | string | |
$style | int | (optional) |
$charset | string | (optional) |
Note: charset applies only to encoding = "entities"
This function is the opposite of "encode()". See "encode()" for details on the available types of encoding.
Name | Type | Description |
---|---|---|
$encoding | string | see the list of valid inputs for details |
$style | string | used for entity conversion |
$charset | string | used for entity conversion |
Note: charset applies only to encoding = "entities"
Returns an encoded version depending on the type of encoding you choose.
The input value is not case-sensitive.
Note: The results of this function can be reversed using the "decode()" function with the same values. If you are looking for checksums and hashing-methods see the "encrypt" function.
The following values are available.
}
Name | Type | Description |
---|---|---|
$encryption | string | see the list of valid inputs for details |
$salt | string | only used for certain encryption types |
Returns an encrypted version depending on the type of encryption you choose.
The input value is not case-sensitive.
Note: The result of this function is alwas irreversible. If you are looking for reversible encryption methods see the "encode" function.
The following values are available.
This method issues an E_USER_NOTICE and returns the integer constant STRING_UNSUPPORTED_ENCRYPTION if the $encryption parameter has an invalid value.
}
Name | Type | Description |
---|---|---|
$something | mixed | some object that should be compared |
Returns
Note: this is unlike the PHP code ($string == $something) where you might accidently run into comparision in e.g. a boolean context.
Redefinition of: Object::equals()
Unboxing the object. This function returns the scalar string value of the object.
Name | Type | Description |
---|---|---|
$input | string | some string |
Name | Type | Description |
---|---|---|
$needle | string | |
$offset | int |
Returns character-offset of first occurence of $needle within this string. Indices starting with int(0).
Returns Java-style int(-1) if $needle is not found, NOT Php-style bool(false). This is because int(0) and bool(false) might get mixed by accident.
So while if
Returns the number of characters in the string.
Name | Type | Description |
---|---|---|
$regularExpression | string |
Matches this string against a given Perl-compatible regular expression. Returns an array containing the FIRST set of matches or bool(false) if the regular expression did not match at all.
Name | Type | Description |
---|---|---|
$regularExpression | string |
Matches this string against a given Perl-compatible regular expression. Returns an array containing ALL the matches or bool(false) if the regular expression did not match at all.
Name | Type | Description |
---|---|---|
$charlist | string | a string of characters that should be unescaped |
Name | Type | Description |
---|---|---|
$needle | string | |
$substitute | string | (optional) |
This will replace all entities of $needle with $substitute. Returns the number of times $needle is replaced.
Name | Type | Description |
---|---|---|
$regularExpression | string | |
$substitute | string | (optional) |
$limit | int | (optional) must be a positive integer > 0, defaults to -1 (no limit) |
This will replace all hits of the Perl-compatible $regularExpression with $substitute.
Returns the number of times $needle is replaced.
Name | Type | Description |
---|---|---|
$value | string | a new string value |
Assigns a new value to the object. Returns the old value.
Name | Type | Description |
---|---|---|
$separator | string | |
$limit | int |
Name | Type | Description |
---|---|---|
$separator | string | |
$limit | int |
Name | Type | Description |
---|---|---|
$start | int | |
$length | int | (optional) |
Returns a substring beginning at character-offset $start with $length characters. See PHP-Manual "string functions" "substr()" for details.
Returns a boolean value depending on the value of the string.
Note: If you just want to check wether a string is empty or not, use $string->equals("") instead.
Converts the string value to a float and returns it. Returns bool(false) if the string is not numeric.
Converts the string value to an integer and returns it. Returns bool(false) if the string is not numeric.
Redefinition of: Object::toString()
Name | Type | Description |
---|---|---|
$width | int | |
$break | string | |
$cut | bool |
Inherited From Object
Documentation generated on Sun, 11 Mar 2007 15:02:46 +0100 by phpDocumentor 1.3.1