xn_strlen()
xn_strlen($s)
【功能】
UTF-8 的编码方式求字符串长度。
函数原型:
function xn_strlen($s) {
return mb_strlen($s, "UTF-8");
}
【参数】
$s:字符串
【用例】
<?php
include "./xiunophp/xiunophp.php";
echo xn_strlen("字符");
// 结果: 2
?>
xn_strlen($s)
UTF-8 的编码方式求字符串长度。
函数原型:
function xn_strlen($s) {
return mb_strlen($s, "UTF-8");
}
$s:字符串
<?php
include "./xiunophp/xiunophp.php";
echo xn_strlen("字符");
// 结果: 2
?>