Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在使用 php cURL 解析页面并使用 DOMDocument() 函数对数据进行切片。解析的页面具有“UTF-8”编码。然后我将数据写入数据库。但不是
музыка
它正在编写这样的 ASCII 代码:
Музыка
我试过 iconv()、mb_convert_encoding()、utf8_encode,但还是一样。strlen() 返回编码字符串的长度。
如何将其编码为普通文本?
<?php $string ="Музыка"; echo html_entity_decode($string, ENT_NOQUOTES, 'UTF-8');
印刷:
Музыка