织梦DEDECMS文章正文调用代码为{dede:field.body/},这样图片和文章都调用出来了。能不能分开调用呢?当然可以啦!调用 代码如下 内容文字 1 2 {dede:field.body runphp=yes} 3 $string = @me; 4 $result = preg_replace("/]+>/i",'',$string); 5 @me = $result; 6 {/dede:field.body} 7 内容图片 01 02 {dede:field.body runphp=yes} 03 $string = @me; 04 preg_match_all("/[i,,*)s*src=('|")([^'",+)('|")/",$string,$matches); 05 $imgsrc_arr = array_unique($matches[3,); 06 foreach($imgsrc_arr as $imgsrc) 07 { 08 $result .= "[*,[i,img" src="$imgsrc"> "; 09 } 10 @me = $result; 11 {/dede:field.body} 12
内容已隐藏,请关注公众号输入验证码查看
本帖支持关注公众号查看
【无套路 无套路 无套路 扫描二维码关注公众号发送【验证码】收到验证码 在上面输入点击提交查看即可显示隐藏内容】
|