yii\helpers\BaseStringHelper::byteLength PHP Method

byteLength() public static method

This method ensures the string is treated as a byte array by using mb_strlen().
public static byteLength ( string $string ) : integer
$string string the string being measured for length
return integer the number of bytes in the given string.
    public static function byteLength($string)
    {
        return mb_strlen($string, '8bit');
    }