Class for string actions
category | OSS |
---|---|
package | OSS_String |
copyright | Copyright (c) 2007 - 2012, Open Source Solutions Limited, Dublin, Ireland |
license | New BSD License |
htmlEntityDecode(mixed $input) : array | string
Otherwise treats the input as a string, and runs html_entity_decode() on it. If the input is an object, then the return value will be an array of the public object properties. The return value is either a string or an array.
mixed
array
string
mb_str_replace(string $needle, string $replacement, string $haystack) : string
string
The string portion to replace in the haystack
string
The replacement for the string portion
string
The haystack
string
mb_ucfirst(string $string, string $encoding) : string
string
the input string
string
default null the character encoding, if omitted the the PHP internal encoding is used
string
mb_ucwords(string $string, string $encoding) : string
string
the input string
string
default null the character encoding, if omitted the the PHP internal encoding is used
string
normalise(string $input, bool $keepSpaces) : string
These settings should be set for working results: mb_language('uni'); mb_internal_encoding('UTF-8'); setlocale(LC_ALL, "en_IE.utf8"); //or any other locale, as long as it's utf8
string
the original input string
bool
By default is false and it will remove spaces from string. Then it is set true it will keep spaces in string.
string
random(int $length, bool $lowerCase, bool $upperCase, bool $numbers, string $additional, string $exclude) : string
int
The length of the random string we want to generate. Default: 16
bool
If true then lowercase characters will be used. Default: true
bool
If true then uppercase characters will be used. Default: true
bool
If true then numbers will be used. Default: true
string
These characters also will be used. Default: ''
string
These characters will be excluded. Default: '1iIl0O'
string
randomFromSet(string $charSet, int $length) : string
string
int
string
randomMacAddress(bool $upperCase) : string
bool
default false
string
randomPassword(int $length) : string
Not the fastest way of generating random passwords, but ensures that it contains both lowercase and uppercase letters and digits, so complies with our password strength "policy".
Some letters are excluded from the character set: 1, 0, O, I, l
int
The length of the password to be generated.
string
The password string.salt(int $len) : string
int
Length of return salt.
string
stripSlashes(mixed $input) : array | string
Otherwise treats the input as a string, and runs stripslashes() on it. If the input is an object, then the return value will be an array of the public object properties. The return value is either a string or an array.
mixed
array
string
toValidFieldName(string $string) : string
Leading and trailing underscores are also removed.
string
string