mb_substr有时作为工作的解决方案


mb_substr as a solution for � works sometimes

Hihi,

我曾经在以特殊字符结尾的字符串末尾获取符号......

我通过在"substr"中添加mb_找到了解决方案,该"substr"变成了(mb_substr(

它有效,但如果我刷新,它仍然不时出现并在某些情况下消失。

有永久修复此错误的方法吗?

问题是 UTF-8 与 ASCII

MB("多字节"(并不是真正的解决方案。

"mb_detect_encoding(("和/或utf8_encode((/utf8_decode可能会让你走得更远:

  • http://php.net/manual/en/function.mb-detect-encoding.php

  • http://php.net/manual/en/function.utf8-encode.php

  • http://php.net/manual/en/function.utf8-decode.php

请阅读此链接中的信息。 如果你还不熟悉PHP"国际化",它可能对你非常有用:

http://www.phpwact.org/php/i18n/utf-8