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
arraystring
mb_str_replace(string $needle, string $replacement, string $haystack) : string
stringThe string portion to replace in the haystack
stringThe replacement for the string portion
stringThe haystack
stringmb_ucfirst(string $string, string $encoding) : string
stringthe input string
stringdefault null the character encoding, if omitted the the PHP internal encoding is used
stringmb_ucwords(string $string, string $encoding) : string
stringthe input string
stringdefault null the character encoding, if omitted the the PHP internal encoding is used
stringnormalise(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
stringthe original input string
boolBy default is false and it will remove spaces from string. Then it is set true it will keep spaces in string.
stringrandom(int $length, bool $lowerCase, bool $upperCase, bool $numbers, string $additional, string $exclude) : string
intThe length of the random string we want to generate. Default: 16
boolIf true then lowercase characters will be used. Default: true
boolIf true then uppercase characters will be used. Default: true
boolIf true then numbers will be used. Default: true
stringThese characters also will be used. Default: ''
stringThese characters will be excluded. Default: '1iIl0O'
stringrandomFromSet(string $charSet, int $length) : string
string
int
stringrandomMacAddress(bool $upperCase) : string
booldefault false
stringrandomPassword(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
intThe length of the password to be generated.
stringThe password string.salt(int $len) : string
intLength of return salt.
stringstripSlashes(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
arraystring
toValidFieldName(string $string) : string
Leading and trailing underscores are also removed.
string
string