uuid()
uuid() : string
Generate a UUID (GUID)
StringObject manipulator trait.
subString(integer $startPosition, integer $length) : $this
Returns a substring from the current string.
integer | $startPosition | From which char position will the substring start. |
integer | $length | Where will the substring end. If 0 - to the end of string. |
replace(string|array $search, string|array $replace) : $this
Replaces the occurrences of $search inside the current string with $replace.
This function is CASE-INSENSITIVE.
string|array | $search | String, or array of strings, that will replaced. |
string|array | $replace | String, or array of strings, with whom $search occurrences will be replaced. |
pregReplace(string $pattern, mixed $replacement, integer $limit = -1, null $count = null) : $this
Replace string using regex
string | $pattern | The pattern to search for. It can be either a string or an array with strings. |
mixed | $replacement | The string or an array with strings to replace. |
integer | $limit | The maximum possible replacements for each pattern in each subject string. Defaults to -1 (no limit). |
null | $count | If specified, this variable will be filled with the number of replacements done. |
explode(string $delimiter, null|integer $limit = null) : \app\framework\Component\StdLib\StdObject\ArrayObject\ArrayObject
Explode the current string with the given delimiter and return ArrayObject with the exploded values.
string | $delimiter | String upon which the current string will be exploded. |
null|integer | $limit | Limit the number of exploded items. |
ArrayObject object containing exploded values.
split(integer $chunkSize = 1) : \app\framework\Component\StdLib\StdObject\ArrayObject\ArrayObject
Split the string into chunks.
integer | $chunkSize | Size of each chunk. Set it to 1 if you want to get all the characters from the string. |
ArrayObject containing string chunks.
hash(string $algo = 'sha1') : $this
Generate a hash value from the current string using the defined algorithm.
string | $algo | Name of the algorithm used for calculation (md5, sha1, ripemd160,...). |
htmlEntityEncode(string|null $flags = null, string $encoding = 'UTF-8') : $this
Convert all HTML entities to their applicable characters.
For more info visit: http://www.php.net/manual/en/function.htmlentities.php
string|null | $flags | Default flags are set to ENT_COMPAT | ENT_HTML401 |
string | $encoding | Which encoding will be used in the conversion. Default is UTF-8. |
chunkSplit(integer $chunkSize = 76, string $endChar = "\n") : $this
Split the string into chunks with each chunk ending with $endChar.
This function is multi-byte safe.
integer | $chunkSize | Size of each chunk. |
string | $endChar | String that will be appended to the end of each chunk. |
parseString() : \app\framework\Component\StdLib\StdObject\ArrayObject\ArrayObject
Parse current string as a query string and return ArrayObject with results.
ArrayObject from the parsed string.
format(string|array $args) : $this
Format the string according to the provided $format.
string|array | $args | Arguments used for string formatting. For more info visit http://www.php.net/manual/en/function.sprintf.php |
padLeft(integer $length, string $padString) : $this
Pad the string to a certain length with another string.
integer | $length | Length to which to pad. |
string | $padString | String that will be appended. |
padRight(integer $length, string $padString) : $this
Pad the string to a certain length with another string.
integer | $length | Length to which to pad. |
string | $padString | String that will be appended. |
padBoth(integer $length, string $padString) : $this
Pad the string to a certain length with another string.
integer | $length | Length to which to pad. |
string | $padString | String that will be appended. |
wordWrap(integer $length, string $break = "\n", boolean $cut = false) : $this
Wraps a string to a given number of characters using a string break character.
integer | $length | The number of characters at which the string will be wrapped. |
string | $break | The line is broken using the optional break parameter. |
boolean | $cut | If the cut is set to TRUE, the string is always wrapped at or before the specified width. So if you have a word that is larger than the given width, it is broken apart. |
truncate(integer $length, string $ellipsis = '') : $this
Truncate the string to the given length without breaking words.
integer | $length | Length to which you which to trim. |
string | $ellipsis | Ellipsis is calculated in the string $length. |
match(string $regEx, boolean $matchAll = true) : \app\framework\Component\StdLib\StdObject\ArrayObject\ArrayObject|boolean
Preg matches current string against the given regular expression.
If you just wish if string is contained within the current string, use StringObject::contains().
string | $regEx | Regular expression to match. |
boolean | $matchAll | Use preg_match_all, or just preg_match. Default is preg_match_all. |
If there are matches, an ArrayObject with the the $matches is returned, else, false is returned.