首页 > 帝国CMS教程 / 帝国cms调用简介时自动清除换行符

帝国cms调用简介时自动清除换行符

文章整理:陈阳 分类:帝国CMS教程来源: 2
帝国cms在列表页调用简介清除换行符方法
列表内容模板(list.var) (*) 勾选使用程序代码$r[smalltext]=str_replace(array("\r\n", "\r", "\n", "<br />", "</p>"),"",str_replace("<p>","",$r[small
帝国cms在列表页调用简介清除换行符方法
列表内容模板(list.var) (*) 勾选使用程序代码
$r[smalltext]=str_replace(array("\r\n", "\r", "\n", "<br />", "</p>"),"",str_replace("<p>","",$r[smalltext]));
$listtemp='[!--smalltext--]';

①、$r[smalltext]的smalltext为简介字段,按需更改。
②、str_replace(array("\r\n", "\r", "\n", "<br />", "</p>"),"",  这段是把字段里的换行、空格、段落过滤掉

帝国cms在内容页调用简介清除换行符方法

<?=esub(str_replace(egetzy('rn'),'',$navinfor[smalltext]),截取字数);?>

 

猜你喜欢

更多

热门标签