mallwo 发表于 2016-11-2 15:30:19

去除ECSHOP图片描述的额外链接并设定图片为绝对地址

2行代码轻松解决:
$goods['goods_desc'] = preg_replace('/\b(https?|ftp|file):\/\/[-A-Z0-9+&@#\/%?=~_|$!:,.;]*/i', '', $goods['goods_desc']);//去除图片的链接
$goods['goods_desc']= str_ireplace('src="/images/' ,'src="http://www.cybn.cn/images/',$goods['goods_desc']);//把图片设定为绝对地址

当然还有种 办法,去除所有商品链接。不过杀伤力太强了~~
$goods['goods_desc'] = ereg_replace("<a [^>]*>|<\/a>","",$row['goods_desc']);// 去掉商品描述所有链接

以上可在includes/lib_goods.php 约744行操作。

页: [1]
查看完整版本: 去除ECSHOP图片描述的额外链接并设定图片为绝对地址