NIUCLOUD是一款SaaS管理后台框架多应用插件+云编译。上千名开发者、服务商正在积极拥抱开发者生态。欢迎开发者们免费入驻。一起助力发展! 广告
# xn\_strlen() ## xn\_strlen() ``` <pre class="calibre11">``` xn_strlen($s) ``` ``` #### 【功能】 UTF-8 的编码方式求字符串长度。 函数原型: ``` <pre class="calibre11">``` function xn_strlen($s) { return mb_strlen($s, 'UTF-8'); } ``` ``` #### 【参数】 ``` <pre class="calibre11">``` $s:字符串 ``` ``` #### 【用例】 ``` <pre class="calibre11">``` <?php include './xiunophp/xiunophp.php'; echo xn_strlen('字符'); // 结果: 2 ?> ``` ```