ITeye博客

织梦 文章替换关键词

onestopweb · 2017-03-13 10:26 · 境-DEDE · Web前端 · Markdown

织梦直接输出文章的内容

{dede:field name='body'/}

 

织梦替换一个关键词后输出文章的内容

{dede:field.body function="str_replace('/uploads/allimg/','http://www.onestopweb.cn/uploads/allimg/',@me)" /}

 

织梦替换多个关键词后输出文章的内容

{dede:field.body runphp="yes"}
    $str=@me;
    $str1=array("AAA","BBB","/uploads/allimg/");
    $str2=array("aaa","bbb","http://www.onestopweb.cn/uploads/allimg/");
    $str3=str_replace($str1,$str2,$str);
    @me=$str3;
{/dede:field.body}

评论(0)

暂无评论。

评论功能维护中,当前仅展示历史评论。