lithium\g11n\Multibyte::substr()
Returns the portion of string specified by the start and length parameters.
Multibyte enabled version of substr()
.
Parameters
-
string
$string
The string to extract the substring from.
-
integer
$start
Position of first character in string (offset).
-
integer
$length
Maximum numbers of characters to use from string.
-
array
$options
Allows for selecting the adapter to use via the
name
options. Will use the'default'
adapter by default.
Returns
stringThe substring extracted from given string.
Links
Source
public static function substr($string, $start, $length = null, array $options = []) {
$defaults = ['name' => 'default'];
$options += $defaults;
return static::adapter($options['name'])->substr($string, $start, $length);
}