php substr() function with utf-8 leaves � marks at the end

前端 未结 7 1443
野的像风
野的像风 2020-11-27 05:32

Here is simple code



        
7条回答
  •  长情又很酷
    2020-11-27 05:42

    PHP5 does not understand UTF-8 natively. It is proposed for PHP6, if it ever comes out.

    Use the multibyte string functions to manipulate UTF-8 strings safely.

    For instance, mb_substr() in your case.

提交回复
热议问题