码迷,mamicode.com
首页 > Web开发 > 详细

php使用strlen()判断中文汉字字符串长度

时间:2016-12-28 01:28:05      阅读:248      评论:0      收藏:0      [点我收藏+]

标签:targe   color   net   bsp   iconv   class   code   编码   ref   

php使用strlen()判断中文汉字字符串长度

 

对于含有中文情况,此时可以采用:

iconv_strlen($str,"UTF-8");

iconv_strlen 是无论是何种编码,均能计算准确字符个数。

 

 

 

aa

 

php使用strlen()判断中文汉字字符串长度

标签:targe   color   net   bsp   iconv   class   code   编码   ref   

原文地址:http://www.cnblogs.com/jingzhishen/p/6227710.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!