<bdo id='L8f99'></bdo><ul id='L8f99'></ul>
<i id='L8f99'><tr id='L8f99'><dt id='L8f99'><q id='L8f99'><span id='L8f99'><b id='L8f99'><form id='L8f99'><ins id='L8f99'></ins><ul id='L8f99'></ul><sub id='L8f99'></sub></form><legend id='L8f99'></legend><bdo id='L8f99'><pre id='L8f99'><center id='L8f99'></center></pre></bdo></b><th id='L8f99'></th></span></q></dt></tr></i><div id='L8f99'><tfoot id='L8f99'></tfoot><dl id='L8f99'><fieldset id='L8f99'></fieldset></dl></div>

  1. <small id='L8f99'></small><noframes id='L8f99'>

    <tfoot id='L8f99'></tfoot>

      <legend id='L8f99'><style id='L8f99'><dir id='L8f99'><q id='L8f99'></q></dir></style></legend>

    1. 如何从 PHP 中的 unicode 代码点获取字符?

      时间:2023-09-22
          <bdo id='dUjzE'></bdo><ul id='dUjzE'></ul>

          <i id='dUjzE'><tr id='dUjzE'><dt id='dUjzE'><q id='dUjzE'><span id='dUjzE'><b id='dUjzE'><form id='dUjzE'><ins id='dUjzE'></ins><ul id='dUjzE'></ul><sub id='dUjzE'></sub></form><legend id='dUjzE'></legend><bdo id='dUjzE'><pre id='dUjzE'><center id='dUjzE'></center></pre></bdo></b><th id='dUjzE'></th></span></q></dt></tr></i><div id='dUjzE'><tfoot id='dUjzE'></tfoot><dl id='dUjzE'><fieldset id='dUjzE'></fieldset></dl></div>

            <tbody id='dUjzE'></tbody>
          <tfoot id='dUjzE'></tfoot><legend id='dUjzE'><style id='dUjzE'><dir id='dUjzE'><q id='dUjzE'></q></dir></style></legend>

          <small id='dUjzE'></small><noframes id='dUjzE'>

              1. 本文介绍了如何从 PHP 中的 unicode 代码点获取字符?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                问题描述

                例如

                如何获取U+010F对应的字符?

                推荐答案

                header('Content-Encoding: UTF-8');
                
                function mb_html_entity_decode($string)
                {
                    if (extension_loaded('mbstring') === true)
                    {
                        mb_language('Neutral');
                        mb_internal_encoding('UTF-8');
                        mb_detect_order(array('UTF-8', 'ISO-8859-15', 'ISO-8859-1', 'ASCII'));
                
                        return mb_convert_encoding($string, 'UTF-8', 'HTML-ENTITIES');
                    }
                
                    return html_entity_decode($string, ENT_COMPAT, 'UTF-8');
                }
                
                function mb_ord($string)
                {
                    if (extension_loaded('mbstring') === true)
                    {
                        mb_language('Neutral');
                        mb_internal_encoding('UTF-8');
                        mb_detect_order(array('UTF-8', 'ISO-8859-15', 'ISO-8859-1', 'ASCII'));
                
                        $result = unpack('N', mb_convert_encoding($string, 'UCS-4BE', 'UTF-8'));
                
                        if (is_array($result) === true)
                        {
                            return $result[1];
                        }
                    }
                
                    return ord($string);
                }
                
                function mb_chr($string)
                {
                    return mb_html_entity_decode('&#' . intval($string) . ';');
                }
                
                var_dump(hexdec('010F'));
                
                var_dump(mb_ord('ó')); // 243
                var_dump(mb_chr(243)); // ó
                

                这篇关于如何从 PHP 中的 unicode 代码点获取字符?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                上一篇:PHP用unicode字符解码和编码json 下一篇:UTF-8 到 Unicode 代码点

                相关文章

                最新文章

                <legend id='hcHiS'><style id='hcHiS'><dir id='hcHiS'><q id='hcHiS'></q></dir></style></legend>
                1. <small id='hcHiS'></small><noframes id='hcHiS'>

                  • <bdo id='hcHiS'></bdo><ul id='hcHiS'></ul>
                  <tfoot id='hcHiS'></tfoot>

                  1. <i id='hcHiS'><tr id='hcHiS'><dt id='hcHiS'><q id='hcHiS'><span id='hcHiS'><b id='hcHiS'><form id='hcHiS'><ins id='hcHiS'></ins><ul id='hcHiS'></ul><sub id='hcHiS'></sub></form><legend id='hcHiS'></legend><bdo id='hcHiS'><pre id='hcHiS'><center id='hcHiS'></center></pre></bdo></b><th id='hcHiS'></th></span></q></dt></tr></i><div id='hcHiS'><tfoot id='hcHiS'></tfoot><dl id='hcHiS'><fieldset id='hcHiS'></fieldset></dl></div>