久久久久久久av_日韩在线中文_看一级毛片视频_日本精品二区_成人深夜福利视频_武道仙尊动漫在线观看

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

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

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

        <bdo id='Qb7KJ'></bdo><ul id='Qb7KJ'></ul>

      PHP:每當我嘗試編寫 UTF-8 時,它都會使用 DOMDocu

      PHP: using DOMDocument whenever I try to write UTF-8 it writes the hexadecimal notation of it(PHP:每當我嘗試編寫 UTF-8 時,它都會使用 DOMDocument 寫入它的十六進制表示法)

          <bdo id='nuLcA'></bdo><ul id='nuLcA'></ul>
          <legend id='nuLcA'><style id='nuLcA'><dir id='nuLcA'><q id='nuLcA'></q></dir></style></legend>

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

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

                <tfoot id='nuLcA'></tfoot>
              • 本文介紹了PHP:每當我嘗試編寫 UTF-8 時,它都會使用 DOMDocument 寫入它的十六進制表示法的處理方法,對大家解決問題具有一定的參考價值,需要的朋友們下面隨著小編來一起學習吧!

                問題描述

                當我嘗試使用 DOMDocument 將 UTF-8 字符串寫入 XML 文件時,它實際上寫入的是字符串的十六進制表示法,而不是字符串本身.

                When I try to write UTF-8 Strings into an XML file using DOMDocument it actually writes the hexadecimal notation of the string instead of the string itself.

                例如:

                &#x5D9;&#x5E8;&#x5D5;&#x5E9;&#x5DC;&#x5D9;&#x5DD;
                

                代替:

                ???????
                

                有什么想法可以解決這個問題嗎?

                Any ideas how to resolve the issue?

                推薦答案

                好的,給你:

                $dom = new DOMDocument('1.0', 'utf-8');
                $dom->appendChild($dom->createElement('root'));
                $dom->documentElement->appendChild(new DOMText('???????'));
                echo $dom->saveXml();
                

                會正常工作,因為在這種情況下,您構建的文檔將保留指定為第二個參數的編碼:

                will work fine, because in this case, the document you constructed will retain the encoding specified as the second argument:

                <?xml version="1.0" encoding="utf-8"?>
                <root>???????</root>
                

                但是,一旦將 XML 加載到未指定編碼的 Document 中,您將丟失在構造函數中聲明的任何內容,這意味著:

                However, once you load XML into a Document that does not specify an encoding, you will lose anything you declared in the constructor, which means:

                $dom = new DOMDocument('1.0', 'utf-8');
                $dom->loadXml('<root/>'); // missing prolog
                $dom->documentElement->appendChild(new DOMText('???????'));
                echo $dom->saveXml();
                

                不會有 utf-8 編碼:

                will not have an encoding of utf-8:

                <?xml version="1.0"?>
                <root>&#x5D9;&#x5E8;&#x5D5;&#x5E9;&#x5DC;&#x5D9;&#x5DD;</root>
                

                因此,如果您加載 XML 內容,請確保它是

                So if you loadXML something, make sure it is

                $dom = new DOMDocument();
                $dom->loadXml('<?xml version="1.0" encoding="utf-8"?><root/>');
                $dom->documentElement->appendChild(new DOMText('???????'));
                echo $dom->saveXml();
                

                它會按預期工作.

                作為替代,您也可以指定編碼 加載文檔后.

                As an alternative, you can also specify the encoding after loading the document.

                這篇關于PHP:每當我嘗試編寫 UTF-8 時,它都會使用 DOMDocument 寫入它的十六進制表示法的文章就介紹到這了,希望我們推薦的答案對大家有所幫助,也希望大家多多支持html5模板網!

                【網站聲明】本站部分內容來源于互聯網,旨在幫助大家更快的解決問題,如果有圖片或者內容侵犯了您的權益,請聯系我們刪除處理,感謝您的支持!

                相關文檔推薦

                Deadlock exception code for PHP, MySQL PDOException?(PHP、MySQL PDOException 的死鎖異常代碼?)
                PHP PDO MySQL scrollable cursor doesn#39;t work(PHP PDO MySQL 可滾動游標不起作用)
                PHP PDO ODBC connection(PHP PDO ODBC 連接)
                Using PDO::FETCH_CLASS with Magic Methods(使用 PDO::FETCH_CLASS 和魔術方法)
                php pdo get only one value from mysql; value that equals to variable(php pdo 只從 mysql 獲取一個值;等于變量的值)
                MSSQL PDO could not find driver(MSSQL PDO 找不到驅動程序)

              • <i id='3JXkf'><tr id='3JXkf'><dt id='3JXkf'><q id='3JXkf'><span id='3JXkf'><b id='3JXkf'><form id='3JXkf'><ins id='3JXkf'></ins><ul id='3JXkf'></ul><sub id='3JXkf'></sub></form><legend id='3JXkf'></legend><bdo id='3JXkf'><pre id='3JXkf'><center id='3JXkf'></center></pre></bdo></b><th id='3JXkf'></th></span></q></dt></tr></i><div class="qwawimqqmiuu" id='3JXkf'><tfoot id='3JXkf'></tfoot><dl id='3JXkf'><fieldset id='3JXkf'></fieldset></dl></div>

                  <tfoot id='3JXkf'></tfoot>

                      <bdo id='3JXkf'></bdo><ul id='3JXkf'></ul>
                      • <legend id='3JXkf'><style id='3JXkf'><dir id='3JXkf'><q id='3JXkf'></q></dir></style></legend>

                          <small id='3JXkf'></small><noframes id='3JXkf'>

                            <tbody id='3JXkf'></tbody>
                          主站蜘蛛池模板: 亚洲日本乱码在线观看 | 精品欧美一区二区三区久久久 | www.成人久久 | 麻豆av电影网 | 亚洲免费成人 | 中文字幕国产精品 | 成人精品国产 | 亚洲视频在线观看免费 | 亚洲视频在线观看一区二区三区 | 五月激情婷婷网 | a级免费黄色片 | 亚洲在线中文字幕 | 国产亚洲精品综合一区 | 日本三级网址 | 欧美一级欧美一级在线播放 | 久久国内 | 国产精品久久久久久久免费大片 | 亚洲精品在线看 | 久草视频在线播放 | 欧美三级网站 | 亚洲成人av | 亚洲草草视频 | 荷兰欧美一级毛片 | 三级成人在线观看 | 98久久 | 亚洲成人精品在线观看 | 国产综合在线视频 | 久久久精品综合 | 一区二区三区福利视频 | 日韩一级 | 免费视频一区二区 | 精品欧美一区二区三区久久久小说 | 一区二区三区久久久 | 精品国产乱码久久久久久蜜柚 | 国产亚洲欧美在线 | 精品国产成人 | 又爽又黄axxx片免费观看 | 911精品美国片911久久久 | 日日干日日 | 电影91久久久 | 亚洲逼院 |