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
Post a Comment