The code returns the length of the given string in bytes. If the $multibyte flag is set to true, then it will also return the length of the string in multibytes.
Shortcut: stringlength
public function length($value, $multibyte = true)
{
return $multibyte ? mb_strlen($value) : strlen($value);
}