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

    • <bdo id='I1GPm'></bdo><ul id='I1GPm'></ul>

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

    1. <legend id='I1GPm'><style id='I1GPm'><dir id='I1GPm'><q id='I1GPm'></q></dir></style></legend>

      1. <tfoot id='I1GPm'></tfoot>

        PHP 字符串中的 Unicode 字符

        时间:2023-09-21
          <tbody id='z6Zkj'></tbody>

          <tfoot id='z6Zkj'></tfoot>

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

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

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

                • <bdo id='z6Zkj'></bdo><ul id='z6Zkj'></ul>
                  本文介绍了PHP 字符串中的 Unicode 字符的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

                  问题描述

                  这个问题看起来很简单,但我一直没能找到答案.

                  This question looks embarrassingly simple, but I haven't been able to find an answer.

                  与以下 C# 代码行等效的 PHP 是什么?

                  What is the PHP equivalent to the following C# line of code?

                  string str = "u1000";
                  

                  此示例使用单个 Unicode 字符创建一个字符串,该字符的Unicode 数值"为是 1000 十六进制(4096 十进制).

                  This sample creates a string with a single Unicode character whose "Unicode numeric value" is 1000 in hexadecimal (4096 in decimal).

                  也就是说,在 PHP 中,如何使用单个 Unicode 字符创建一个字符串,该字符的Unicode 数值"为知道吗?

                  That is, in PHP, how can I create a string with a single Unicode character whose "Unicode numeric value" is known?

                  推荐答案

                  因为 JSON 直接支持 uxxxx 语法我首先想到的是:

                  Because JSON directly supports the uxxxx syntax the first thing that comes into my mind is:

                  $unicodeChar = 'u1000';
                  echo json_decode('"'.$unicodeChar.'"');
                  

                  另一种选择是使用 mb_convert_encoding()

                  echo mb_convert_encoding('&#x1000;', 'UTF-8', 'HTML-ENTITIES');
                  

                  或者利用 UTF-16BE(大端)和 Unicode 代码点之间的直接映射:

                  or make use of the direct mapping between UTF-16BE (big endian) and the Unicode codepoint:

                  echo mb_convert_encoding("x10x00", 'UTF-8', 'UTF-16BE');
                  

                  这篇关于PHP 字符串中的 Unicode 字符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!

                  上一篇:禁用 Laravel 的内置错误屏幕 下一篇:PHP 中的 preg_match 和 UTF-8

                  相关文章

                  最新文章

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

                      <bdo id='TFXNS'></bdo><ul id='TFXNS'></ul>
                    1. <legend id='TFXNS'><style id='TFXNS'><dir id='TFXNS'><q id='TFXNS'></q></dir></style></legend>

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

                    2. <tfoot id='TFXNS'></tfoot>