PHP中使用substr截取字符串出现中文乱码问题该怎么办

如题所述

第1个回答  2020-01-08
使用mb_substr()函数就可以了,四个参数,解释如下
str
从该
string
中提取子字符串。
start
str
中要使用的第一个字符的位置。
length
str
中要使用的最大字符数。
If
omitted
or
NULL
is
passed,
extract
all
characters
to
the
end
of
the
string.
encoding
encoding
参数为字符编码。如果省略,则使用内部字符编码。
相似回答