private function JS_charCodeAt($str, $index) {
        $utf16 = mb_convert_encoding($str, 'UTF-16LE', 'UTF-8');
        return ord($utf16[$index*2]) + (ord($utf16[$index*2+1]) << 8);
    }
private function JS_charCodeAt($str, $index) {
        $utf16 = mb_convert_encoding($str, 'UTF-16LE', 'UTF-8');
        return ord($utf16[$index*2]) + (ord($utf16[$index*2+1]) << 8);
    }
private function JS_charCodeAt ( $ str , $ index ) { $ utf16 = mb_convert_encoding ( $ str , 'UTF-16LE' , 'UTF-8' ) ; return ord ( $ utf16 [ $ index * 2 ] ) + ( ord ( $ utf16 [ $ index * 2 + 1 ] ) << 8 ) ; }
Get JS charCodeAt equivalent result with UTF-16 encoding

@param string $str
@param int    $index

@return number
Get JS charCodeAt equivalent result with UTF - 16 encoding