php使用mb_substr截取后的中字符乱码

给mb_substr函数最后面加上一个参数即可:

mb_substr("今天是个好日子",0,19, 'utf-8')

猜你喜欢

转载自blog.csdn.net/qq_42249896/article/details/92061446