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\Closure
ends_with(string $str, string $end, boolean $ignore_case) : boolean
string
string to check
string
ending to check for
boolean
whether to ignore the case
boolean
whether a string ends with a specified endingincrement(string $str, int $first, string $separator) : string
string
required
int
number that is used to mean first
string
separtor between the name and the number
string
is_html(string $string) : bool
string
string to check
bool
is_json(string $string) : bool
string
string to check
bool
is_serialized(string $string) : bool
string
string to check
bool
is_xml(string $string) : bool
string
string to check
\FuelException |
---|
bool
lcfirst(string $str, string $encoding) : string
Does not strtoupper first
string
required
string
default UTF-8
string
length($str, $encoding)
lower($str, $encoding)
random(string $type, int $length) : string
string
the type of string
int
the number of characters
string
the random stringstarts_with(string $str, string $start, boolean $ignore_case) : boolean
string
string to check
string
beginning to check for
boolean
whether to ignore the case
boolean
whether a string starts with a specified beginningstripos(string $haystack, mixed $needle, int $offset, string $encoding) : mixed
string
The string from which to get the position of the last occurrence of needle
mixed
The string to find in haystack
int
The search offset
string
Defaults to the setting in the config, which defaults to UTF-8
mixed
Returns 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
string
The string from which to get the position of the last occurrence of needle
mixed
The string to find in haystack
int
Determines which portion of haystack this function returns
string
Defaults to the setting in the config, which defaults to UTF-8
mixed
The portion of haystack, or FALSE if needle is not foundstrlen(string $str, string $encoding) : int
string
The string being measured for length.
string
Defaults to the setting in the config, which defaults to UTF-8
int
The length of the string on success, and 0 if the string is empty.strpos(string $haystack, mixed $needle, int $offset, string $encoding) : mixed
string
The string being checked
mixed
The string to find in haystack
int
The search offset
string
Defaults to the setting in the config, which defaults to UTF-8
mixed
Returns 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
string
The string from which to get the last occurrence of needle
mixed
The string to find in haystack
string
Defaults to the setting in the config, which defaults to UTF-8
mixed
The portion of haystack, or FALSE if needle is not foundstrripos(string $haystack, mixed $needle, int $offset, string $encoding) : mixed
string
The string from which to get the position of the last occurrence of needle
mixed
The string to find in haystack
int
The search offset
string
Defaults to the setting in the config, which defaults to UTF-8
mixed
Returns 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
string
The string being checked
mixed
The string to find in haystack
int
The search offset
string
Defaults to the setting in the config, which defaults to UTF-8
mixed
Returns 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
string
The string from which to get the position of the last occurrence of needle
mixed
The string to find in haystack
int
Determines which portion of haystack this function returns
string
Defaults to the setting in the config, which defaults to UTF-8
mixed
The portion of haystack, or FALSE if needle is not foundstrtolower(string $str, string $encoding) : string
string
The string to convert to lowercase
string
Defaults to the setting in the config, which defaults to UTF-8
string
The lowercased stringstrtoupper(string $str, string $encoding) : string
string
The string to convert to uppercase
string
Defaults to the setting in the config, which defaults to UTF-8
string
The uppercased stringsub($str, $start, $length, $encoding)
substr($str, $start, $length, $encoding)
substr_count(string $haystack, mixed $needle, int $offset, string $encoding) : int
string
The string from which to get the position of the last occurrence of needle
mixed
The string to find in haystack
int
The search offset
string
Defaults to the setting in the config, which defaults to UTF-8
int
The number of occurences foundtr(string $string, array $array) : string
string
string to parse
array
params to str_replace
string
truncate(string $string, int $limit, string $continuation, bool $is_html) : string
It will optionally preserve HTML tags if $is_html is set to true.
string
the string to truncate
int
the number of characters to truncate too
string
the string to use to denote it was truncated
bool
whether the string has HTML
string
the truncated stringucfirst(string $str, string $encoding) : string
Does not strtolower first
string
required
string
default UTF-8
string
ucwords(string $str, string $encoding) : string
First strtolower then ucwords
ucwords normally doesn't strtolower first but MB_CASE_TITLE does, so ucwords now too
string
required
string
default UTF-8
string
upper($str, $encoding)