PHP strlen and mb_strlen not working as expected
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试): 问题: PHP functions strlen() and mb_strlen() both are returning the wrong number of characters when I run them on a string. Here is a piece of the code I'm using... $foo = mb_strlen($itemDetails['ITEMDESC'], 'UTF-8'); echo $foo; It also tells me that this string - "Infant Heel Warmer, No Adhesive Attachment Pad, 100/cs" is 54, which is correct. I assume its some issue with character encoding, everything should be UTF-8 I think. I've tried feeding mb_strlen() several different character encoding types and they all are returning this oddball count