Stichoza\GoogleTranslate\Tokens\GoogleTokenGenerator::charCodeAt PHP Метод

charCodeAt() приватный Метод

Get the Unicode of the character at the specified index in a string.
private charCodeAt ( string $str, integer $index ) : null | number
$str string
$index integer
Результат null | number
    private function charCodeAt($str, $index)
    {
        $char = mb_substr($str, $index, 1, 'UTF-8');
        if (mb_check_encoding($char, 'UTF-8')) {
            $ret = mb_convert_encoding($char, 'UTF-32BE', 'UTF-8');
            $result = hexdec(bin2hex($ret));
            return $result;
        }
        return;
    }