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 -

performance - Why is XCHG reg, reg a 3 micro-op instruction on modern Intel architectures? -

jquery - Responsive Navbar with Sub Navbar -