Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

Will it make any difference or impact on my result, if I use substr() instead of mb_substr() function?

As my server does not have support for mb_ functions, I have to replace it with substr()

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
656 views
Welcome To Ask or Share your Answers For Others

1 Answer

If you have utf-8 encoding use mb_substr

Example :

echo substr("hi mémé", 0 , 5); // will print hi m?
echo mb_substr("hi mémé", 0 , 5); // will print hi mé

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...