企业🤖AI智能体构建引擎,智能编排和调试,一键部署,支持知识库和私有化部署方案 广告
# 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 ?> ``` ```