// 计算中文字符串长度
protected function utf8_strlen($string = null) {
// 将字符串分解为单元ss
preg_match_all("/./us", $string, $match);
// 返回单元个数ss
return count($match[0]);
}
计算中文字符串长度
最新推荐文章于 2023-08-07 11:01:26 发布
// 计算中文字符串长度
protected function utf8_strlen($string = null) {
// 将字符串分解为单元ss
preg_match_all("/./us", $string, $match);
// 返回单元个数ss
return count($match[0]);
}