Check char size in utf8 encoding
Is there any simple solution to check on how m开发者_如何学编程any bytes are stored char in utf8.
If you have a string, then :
strlen()
will give you the number of bytes it takes- while
mb_strlen()
will give you the number of characters it contains
strlen() returns the number of bytes. mb_strlen() returns the number of multibyte characters.
精彩评论