alternator()
ends_with()
increment()
is_html()
is_json()
is_serialized()
is_xml()
lcfirst()
length()
lower()
random()
starts_with()
stripos()
stristr()
strlen()
strpos()
strrchr()
strripos()
strrpos()
strstr()
strtolower()
strtoupper()
sub()
substr()
substr_count()
tr()
truncate()
ucfirst()
ucwords()
upper()
String handling with encoding support
PHP needs to be compiled with --enable-mbstring or a fallback without encoding support is used
alternator() : \Fuel\Core\Closure
If you call the closure with false as the arg it will return the value without alternating the next time.
\Fuel\Core\Closureends_with(string $str, string $end, boolean $ignore_case) : boolean
stringstring to check
stringending to check for
booleanwhether to ignore the case
booleanwhether a string ends with a specified endingincrement(string $str, int $first, string $separator) : string
stringrequired
intnumber that is used to mean first
stringsepartor between the name and the number
stringis_html(string $string) : bool
stringstring to check
boolis_json(string $string) : bool
stringstring to check
boolis_serialized(string $string) : bool
stringstring to check
boolis_xml(string $string) : bool
stringstring to check
\FuelException |
|---|
boollcfirst(string $str, string $encoding) : string
Does not strtoupper first
stringrequired
stringdefault UTF-8
stringlength($str, $encoding)
lower($str, $encoding)
random(string $type, int $length) : string
stringthe type of string
intthe number of characters
stringthe random stringstarts_with(string $str, string $start, boolean $ignore_case) : boolean
stringstring to check
stringbeginning to check for
booleanwhether to ignore the case
booleanwhether a string starts with a specified beginningstripos(string $haystack, mixed $needle, int $offset, string $encoding) : mixed
stringThe string from which to get the position of the last occurrence of needle
mixedThe string to find in haystack
intThe search offset
stringDefaults to the setting in the config, which defaults to UTF-8
mixedReturns the position of where the needle exists relative to the beginning
of the haystack string (independent of offset). Also note that string
positions start at 0, and not 1.
Returns FALSE if the needle was not found.stristr(string $haystack, mixed $needle, int $before_needle, string $encoding) : mixed
stringThe string from which to get the position of the last occurrence of needle
mixedThe string to find in haystack
intDetermines which portion of haystack this function returns
stringDefaults to the setting in the config, which defaults to UTF-8
mixedThe portion of haystack, or FALSE if needle is not foundstrlen(string $str, string $encoding) : int
stringThe string being measured for length.
stringDefaults to the setting in the config, which defaults to UTF-8
intThe length of the string on success, and 0 if the string is empty.strpos(string $haystack, mixed $needle, int $offset, string $encoding) : mixed
stringThe string being checked
mixedThe string to find in haystack
intThe search offset
stringDefaults to the setting in the config, which defaults to UTF-8
mixedReturns the position of where the needle exists relative to the beginning
of the haystack string (independent of offset). Also note that string
positions start at 0, and not 1.
Returns FALSE if the needle was not found.strrchr(string $haystack, mixed $needle, $before_needle, string $encoding) : mixed
stringThe string from which to get the last occurrence of needle
mixedThe string to find in haystack
stringDefaults to the setting in the config, which defaults to UTF-8
mixedThe portion of haystack, or FALSE if needle is not foundstrripos(string $haystack, mixed $needle, int $offset, string $encoding) : mixed
stringThe string from which to get the position of the last occurrence of needle
mixedThe string to find in haystack
intThe search offset
stringDefaults to the setting in the config, which defaults to UTF-8
mixedReturns the numeric position of the last occurrence of needle in the
haystack string. If needle is not found, it returns FALSE.strrpos(string $haystack, mixed $needle, int $offset, string $encoding) : mixed
stringThe string being checked
mixedThe string to find in haystack
intThe search offset
stringDefaults to the setting in the config, which defaults to UTF-8
mixedReturns the numeric position of the last occurrence of needle in the
haystack string. If needle is not found, it returns FALSE.strstr(string $haystack, mixed $needle, int $before_needle, string $encoding) : mixed
stringThe string from which to get the position of the last occurrence of needle
mixedThe string to find in haystack
intDetermines which portion of haystack this function returns
stringDefaults to the setting in the config, which defaults to UTF-8
mixedThe portion of haystack, or FALSE if needle is not foundstrtolower(string $str, string $encoding) : string
stringThe string to convert to lowercase
stringDefaults to the setting in the config, which defaults to UTF-8
stringThe lowercased stringstrtoupper(string $str, string $encoding) : string
stringThe string to convert to uppercase
stringDefaults to the setting in the config, which defaults to UTF-8
stringThe uppercased stringsub($str, $start, $length, $encoding)
substr($str, $start, $length, $encoding)
substr_count(string $haystack, mixed $needle, int $offset, string $encoding) : int
stringThe string from which to get the position of the last occurrence of needle
mixedThe string to find in haystack
intThe search offset
stringDefaults to the setting in the config, which defaults to UTF-8
intThe number of occurences foundtr(string $string, array $array) : string
stringstring to parse
arrayparams to str_replace
stringtruncate(string $string, int $limit, string $continuation, bool $is_html) : string
It will optionally preserve HTML tags if $is_html is set to true.
stringthe string to truncate
intthe number of characters to truncate too
stringthe string to use to denote it was truncated
boolwhether the string has HTML
stringthe truncated stringucfirst(string $str, string $encoding) : string
Does not strtolower first
stringrequired
stringdefault UTF-8
stringucwords(string $str, string $encoding) : string
First strtolower then ucwords
ucwords normally doesn't strtolower first but MB_CASE_TITLE does, so ucwords now too
stringrequired
stringdefault UTF-8
stringupper($str, $encoding)