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 核心没有字符编码的概念。字符串只是 - 正如手册所述 - 字节系列(无符号 8 位)。输出媒体如何解释这些字节是...超越 php。 在您的示例中,Ø 可能是 utf-8 编码的,即两个字节 195 和 152。PHP 不知道编码将这两个字节视为两个单独的单字节“字符”。ord()只考虑字符串中的第一个“字符”,所以你得到195. 所以答案是:无符号,根本没有字符集......只是带有长度指示符的字节。
ord()
195