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 中将 utf-8 字符串转换为 utf-16 字符串?
mbstring支持 UTF-16,所以你可以使用mb_convert_encoding.
mb_convert_encoding
你也可以使用iconv.
iconv
它在 PHP 中是原生的,但要求您的所有文本都是一个字符集。否则它可能会丢弃字符。