Str.php
public static function length(string $str, string $encoding = null) : int
    {
        return mb_strlen($str, $encoding ?: static::encoding($str));
    }
public static function length(string $str, string $encoding = null) : int
    {
        return mb_strlen($str, $encoding ?: static::encoding($str));
    }
public static function length ( string $ str , string $ encoding = null ) : int { return mb_strlen ( $ str , $ encoding ? : static :: encoding ( $ str ) ) ; }
Determines the length of a given string. Counts multi-byte characters as single characters.

@param   string  $str        The string to count characters in.
@param   string  $encoding   The encoding to use.
@return  int                 The length of the string.
Determines the length of a given string . Counts multi - byte characters as single characters .