mb_strlen会
原文链接:/php/138721.htmlReturn the number of characters in string $str having character encoding $encoding. A multi-byte character is counted as 1.
您的内部编码可能未设置为utf-8,因此也是如此
echo mb_strlen('òàùè','utf8');
或者在全球范围内设置utf8:
mb_internal_encoding('utf8');
然后呢
echo mb_strlen("òàùè");
会给4(demo)