Property | Type | Description | |
---|---|---|---|
$value | string |
Method | Description | |
---|---|---|
__construct ( string | integer $value ) | Constructor. | |
__toString ( ) : string | To string implementation. | |
length ( ) : integer | Get the length of the current string. | |
offsetExists ( mixed $offset ) : boolean |
(PHP 5 >= 5.0.0) Whether a offset exists |
|
offsetGet ( mixed $offset ) : mixed |
(PHP 5 >= 5.0.0) Offset to retrieve |
|
offsetSet ( mixed $offset, mixed $value ) : void |
(PHP 5 >= 5.0.0) Offset to set |
|
offsetUnset ( mixed $offset ) : void |
(PHP 5 >= 5.0.0) Offset to unset |
|
subStringCount ( string $string, null | integer $offset, null | integer $length = null ) : integer | Get number of string occurrences in current string. | |
wordCount ( integer $format ) : mixed | |
Get the number of words in the string. |
public __construct ( string | integer $value ) | ||
$value | string | integer | A string from which the StringObject instance will be created. |
public __toString ( ) : string | ||
return | string | Current string. |
public offsetExists ( mixed $offset ) : boolean | ||
$offset | mixed | An offset to check for. |
return | boolean | true on success or false on failure.
The return value will be casted to boolean if non-boolean was returned. |
public offsetUnset ( mixed $offset ) : void | ||
$offset | mixed | The offset to unset. |
return | void |
public subStringCount ( string $string, null | integer $offset, null | integer $length = null ) : integer | ||
$string | string | String to search for |
$offset | null | integer | The offset where to start counting |
$length | null | integer | The maximum length after the specified offset to search for the substring. It outputs a warning if the offset plus the length is greater than the haystack length. |
return | integer |
public wordCount ( integer $format ) : mixed | |
||
$format | integer | Specify the return format: 0 - return number of words 1 - return an ArrayObject containing all the words found inside the string 2 - returns an ArrayObject, where the key is the numeric position of the word inside the string and the value is the actual word itself |
return | mixed | |
An ArrayObject or integer, based on the wanted $format, with the stats about the words in the string. |