Count string length in byte using mb_strlen in php -


i got trouble while using mb_strlen function.

mb_strlen('12', 'shift-jis') got 4 (full width char)

mb_strlen('12', 'shift-jis')` got 2

meanwhile mb_strlen('1212', 'shift-jis') got 5????

anyone know how count there strings in byte? please help!!!

if want number of bytes in string, use strlen function.

it number of characters in string more difficult get.


Comments

Popular posts from this blog

Is there a better way to structure post methods in Class Based Views -

reflection - How to access the object-members of an object declaration in kotlin -

php - Doctrine Query Builder Error on Join: [Syntax Error] line 0, col 87: Error: Expected Literal, got 'JOIN' -