更多函数总结:" />

"景先生毕设|www.jxszl.com

织梦dedecms系统字符串内容截取函数

2022-10-29 16:31编辑: www.jxszl.com景先生毕设
在织梦(即dedecms)II次开发以及网站建设时,我们经常会用到字符串截取的问题,在织梦中字符串内容截取函数比较常用的有两个.今天,VIII0空间小编来给大家说I.下这两个函数.
HtmlIItext()函数是去掉html标签代码.
cn_substr(str,VIII0)函数是截

 更多精彩就在: 51免费论文网|www.jxszl.com 
取字符串长度.
当然,他们也可以合并起来使用:
[field:bodyfunction="cn_substr(HtmlIItext(@me),VIII0)"/]

更多函数总结:
基本语法:
函数I.:function=cn_substr(@me,II00)(功能:获取指定数值的字符串)
函数II:function=htmlIItext(@me)(功能:去掉html样式,转换为纯文本字符)
函数III:function=GetDateTimeMk(‘@me’)(功能:根据秒数返回时间)
函数IV:function=GetDateMK(@me)(功能:根据秒数返回日期)
函数V:function=‘strftime(%m-%d",@me)’(功能:根据秒数返回格式化的日期或者时间,php自带的函数)
首页:
0VIII[field:pubdatefunction=strftime(%d,@me)/]
0VIII日[field:pubdatefunction=strftime(%d日,@me)/]
0VI-0VIII[field:pubdatefunction=strftime(%m-%d,@me)/]
0VI月0VIII日[field:pubdatefunction=strftime(%m月%d日,@me)/]
0IX-0VI-0VIII[field:pubdatefunction=strftime(%y-%m-%d,@me)/]
II00IX-0VI-0VIII[field:pubdatefunction=strftime(%Y-%m-%d,@me)/]
0IX年0VI月0VIII日[field:pubdatefunction=strftime(%y年%m月%d日,@me)/]
II00IX年0VI月0VIII日[field:pubdatefunction=strftime(%Y年%m月%d日,@me)/]
II00IX-0VI-0VIIII.III:IIVIII[field:pubdatefunction=strftime(%Y-%m-%d%H:%M,@me)/]
列表页:
[field:pubdatefunction="GetDateTimeMK(@me)"/]==II00VIII-I.-I.I.VIII:III0:0II
[field:pubdatefunction="GetDateMK(@me)"/]==II00VIII-0V-I.V
函数VI:function=‘str_replace(lit_",",@me)(功能:替换字符串)
函数VII:function=MyDate(‘m-d’,@me)(功能:返回格林威治标准时间)
组合函数:function="htmlIItext(cn_substr(@me,II00))"(功能:提取指定个数的字符串并去掉html样式,转换为纯文本字符)
举例:
{dede:field.contentfunction="HtmlIIText(cn_substr(@me,I.I.0))"/}
功能:获取栏目信息摘要信息(提取I.I.0个字符[VV个汉字]),删除hml标签元素,转为纯文本!


原文链接:http://www.jxszl.com/biancheng/dedecms/75531.html