中英文混合字符数统计

作者: dreamfly 分类: php 发布时间: 2016-03-31 18:30

中英文混合字符串统计:

int iconv_strlen ( string$str [, string$charset= ini_set(“iconv.internal_encoding”) ] )

1
2
3
4
5
6
<?php
 
$s = "中文English";
echo iconv_strlen($s, 'utf-8'); //out:9
 
?>

如果觉得我的文章对您有用,请随意打赏。您的支持将鼓励我继续创作!