$str = 'hello world!';
$sss = '中华民国';
echo mb_strlen($str) // 12; urf编码下,一个中文 字符 占用 3个字节;
echo mb_strlen($sss,'utf-8') //4; utf-8 字符编码下,字符串 $sss的 字符 个数是4;
echo mb_strlen($sss) // 12; 这个是为什么呢?
echo mb_strlen($sss,'gbk') // 6; 不是应该输出4吗?
$str = 'hello world!';
$sss = '中华民国';
echo mb_strlen($str) // 12; urf编码下,一个中文 字符 占用 3个字节;
echo mb_strlen($sss,'utf-8') //4; utf-8 字符编码下,字符串 $sss的 字符 个数是4;
echo mb_strlen($sss) // 12; 这个是为什么呢?
echo mb_strlen($sss,'gbk') // 6; 不是应该输出4吗?