cn_substr
(DedeCms V57,V56,V55,V53)
cn_substr - 对中文字符串进行截取(单字节截取模式)
说明:
string cn_substr(string $str, int $slen[, int $startdd])
参数:
$str 需要截取的字符串
$slen 截取的长度
$startdd 开始标记处,默认为 0,也就是从头开始截取
返回:
返回截取后的字符串,错误返回空字符串
位置:
include/helpers/string.helpers.php
示例:
1.直接调用
{field:description function='cn_substr(@me, 200)'/}
2.标签嵌套
{dede:arclist flag='h' typeid=''} <a href='[field:arcurl/]'>[field:title function='cn_substr(@me,30)'/]</a> {/dede:arclist}
本文为原创文章,版权归主机之家测评所有,欢迎分享本文,转载请保留出处!
你可能也喜欢
- ♥ Mac 下编译安装 PHP7 时报错:configure: error: Please specify the install prefix of iconv with --with-iconv=<DIR>的解决办法08/28
- ♥ 【疯狂猜成语/图猜成语】海底有一块石头是什么成语?08/18
- ♥ php 随机生成 n 个汉字字符串函数08/24
- ♥ php:Illegal offset type in XXX 错误原因及解决方法08/22
- ♥ layer 子窗体界面大于父窗体界面的实现方法09/05
- ♥ $(document).ready()方法和 window.onload 方法的区别08/26